Hey guys,
I'm working on the final touches of my workflow. And toward the end I want my workflow to Get Items (from a sharepoint list, and using the filter query Title eq Model_ID variable and Status eq In Progress):
- If an item is found, then the next steps can be skipped
- If an item is not found, then the next step (Create item) can run.
As such, I have configured the Create item action to run only when the Get Items has failed, because I thought that if it doesn't find an item, it fails...
But when testing the workflow, I noticed, that despite not finding a matching item, it comes with a Status Code 200, meaning it's successful, but the body message is obviously empty, cause no items were found. It actually says "value": []. This has an impact on my next steps, because it doesn't create the item as it should.
My first solution to fix this was trying have a Condition after Get Items where:
outputs('Search_for_an_existing_in_progress_Phase_2')['statusCode'] is equal to 200 AND outputs('Search_for_an_existing_in_progress_Phase_2')['body/message'] is [left empty]
So if it's true, then I can Create item, if not, i terminate my flow.
I also tried body, instead of body/message; I also tried "value": [] instead of leaving it empty.
None of these options seem to work.
Any ideas on how to address this in the best way? Is there something else I could try instead of "value": [] and leaving it empty?