Stop Flow if a Lookup yields zero results?
I've got a few flows that will fail miserably if a previous lookup failed to yield results. I've looked through the lookup settings page and don't see any way to indicate minimum result count or anything that could be used to catch this. I've thought about a script that could throw an exception, but that adds complexity.
Is there a trick to stop a flow with an error if a lookup doesn't yield results? If not, can you enter that as a request?
1
Comments
Hi, Steve Klett.
Have you tried this option?
Hi Stephen,
Doesn't apply in this case because IIO correctly interprets a lookup with no results as a success. What is needed is an option on the lookup to tell it zero results is NOT a success. Super easy feature to add, you guys should totally do it. :)
Hi Steve Klett,
If this is the case, then you can set the success path in your import lookup.
Ex: let say from the lookup import for success, you got results as: {results [{id: "123"}]. and for empty response you got as {results : []}.
Now all you need to do is set the success path as "results[0].id", now always it will check for the path present or not from the response, otherwise, it will give you an error.
you can find the success path in the import lookup --> Non-standard API respose --> Success path. Add the success path here, you no need to set the success value. all we are required to check the id present in a zeroth index or not.
Hope this helps you.
Please sign in to leave a comment.