Using increment counter to limit passes to 1

I am trying to limit the passes of the part circled in red to 1 only, so the message is only send once, even if for some reason the scenario is run again.

I think the solution is in an increment counter in that part, but have dificulties setting it up in a way that it works. Any suggestions?

To check if something has been done before, you’ll need to store it in persistent storage and not just an increment counter.

You can use two modules for that, one to find from datastore, and one to create new record in the datastore. Then add a filter between those two modules to stop execution of that branch if the record exists.

3 Likes

ok, I have added a datastore with just the order ID, it will be saved at the end of the scene, so the first time without the id stored it should pass through, the second time, with the ID in the database it should stop, I cannot figure out how to configure the condition in the check for an order in the datastore. This is what I have done but is not working

the first 2 condition in the filter are OK, but how do I use the exists in the database part?


you can use search module of data store and search for order number in your datastore and if the result is found , it will not have to continue and if result is not found it will continue and at end it will add the record to datastore and when it run again it will find a record and it will not proceed further .
simply put the Order ID field in the filter and set the value to exsist ,

3 Likes

Thanks for the help I got it sorted out with your suggestions.



Hello @timstijntjes welcome to the community :wave:

I just wanted to quickly jump in and say congrats on solving this one with the help of @samliew and @CodexSolutions. It’s great to see that you got the ball rolling. :clap:

Also, thank you very much for getting back to us and sharing your final solution with the community. We 100% appreciate that you kept us in mind and marked the problem as solved so that other users can easily find the answer when facing similar issues. :blush:

2 Likes