Skip to main content
Best answer

How does _zap_search_success_on_miss work

  • September 3, 2024
  • 2 replies
  • 108 views

Hi all, I’m maintaining a zapier CLI integration that has a search that is erroring out even if the _zap_search_success_on_miss is set to true.

Is this something that Zapier will deal with automatically if I throw the right kind of error or do I need to parse it myself from the inputDataRaw? I can't find any documentation around that variable.

Best answer by Osas

Hi @conan-x 

If the _zap_search_success_on_miss is set to true and the Zap still errors, then it means that what the API returns is not what Zapier expects. As seen here, when a value cannot be found, an empty array should be returned by the integration.

Do ensure that the search actions return an empty array when a value cannot be found. You can do this by using code mode to add a Javascript condition for this search action that if a 404 error is returned by your API (or any other status code that your API uses to signify a not-found error), an empty array should be returned. Anything other then this, then the Zap would not respect the _zap_search_success_on_miss value

Hope that helps.

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+3
  • Zapier Staff
  • 43 replies
  • Answer
  • September 11, 2024

Hi @conan-x 

If the _zap_search_success_on_miss is set to true and the Zap still errors, then it means that what the API returns is not what Zapier expects. As seen here, when a value cannot be found, an empty array should be returned by the integration.

Do ensure that the search actions return an empty array when a value cannot be found. You can do this by using code mode to add a Javascript condition for this search action that if a 404 error is returned by your API (or any other status code that your API uses to signify a not-found error), an empty array should be returned. Anything other then this, then the Zap would not respect the _zap_search_success_on_miss value

Hope that helps.


  • Author
  • Beginner
  • 2 replies
  • September 12, 2024

That’s exactly what I was looking for. Thanks a lot for the clarity and pointing to the docs. The Zapier docs are vast and it’s been a long time since I looked through that bit and didn’t turn up in my search engine.