I would like to search a data store, and if the search turns up no results, I want to proceed down a specific route downstream of that module (specifically, "there's no record for this already? then let's create one!")
However, whenever there is no Output for a search module, the scenario ends and I can't continue.
Is there any way to accomplish my use case such that the absence of data can serve as a condition to continue processing down a certain route?
Thank you.
Topics help categorize Community content and increase your ability to discover relevant content.
OP again. I came up with something that worked. Instead of searching the DataStore and using NO output as the condition to continue, I searched the DataStore first for all records and then compiled all of them into an array. I could then could use a filter condition with Array operators to find out if the value I'm looking for is contained or not contained in the array.
This seems to have gotten me past my hurdle, though I have to continue testing.
I don't know how you have your data store setup because I've never used them but comparing it to {{emptystring}} checks for empty things. Go back to your first screenshot using the router and make a path that says if record == emptystring , create record. I usually create my path with a condition then mark the other as fallback to default it.
Views
Replies
Total Likes
I would check whether the key "exists"
Views
Replies
Total Likes
OP again with an update. I received excellent support from Adobe's @yashpandey who provided me with precisely the solution I was looking for, and I want to share it.
Earlier, I had missed an Advanced Setting in the Data Store - Search module, a set of radio buttons labeled "Continue the execution of the route even if the module returns no results":
So now that I've selected Yes, the execution continues and it branches into 2 paths differentiated by the "length(array)=0" filter (the other path filter being Array length greater than 0) shown in this screen cap:
And that is how I was able to implement my use case. Many thanks again to Yash!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies