28 Nov 2024 08:24 AM
Good morning community,
I'm using workflow to retrieve data from D365 and then push it to Dynatrace.
Sometimes the call to the api doesn't provide any data and push_log_to_dynatrace step will fail. (see image)
I was wondering: how can I put a condition that stop the flow if no data was retrieved from the API?
Regards
Solved! Go to Solution.
04 Dec 2024 07:57 AM
04 Dec 2024 09:12 AM
Unfortunately no, but I appreciate your help.
Condition should be "if you have no value in the array then gracefully stop the execution" and I don't find a practical reference to do that.
I revert back to using Power Automate which has an extensive documentation and use case already covred.
Thank you
06 Dec 2024 11:02 AM
You can use Task Conditions to enable/disable a Task based on a previous task. In this particular case, you can use the length filter.
For example, on the task post_log_into_dynatrace, switch to Conditions, and try out the following expression in the "And custom condition was met" field:
{{ result("d365_masterdata_intmat").json.value | length > 0 }}
This should lead to this specific task not being executed when the result is an empty list.
Hope this helps!