It seems like the objects you are comparing with are stored in the database. You could do it without a loop and only retrieve a list of objects by xpath.
[attribute = $MyProgram/attribute]
If this returns an empty list, there is no object with this value in the database and you are good to go.
This solution should be much faster on larger datasets.
The exclusive split would just need to be the first activity in your loop. If its true use the show message activity, if its false use the continue event.
I would also check out the learning modules.
Hope this helps!
Thank you very much for the answer. I tried exactly like you adviced, and it almost works. I just miss something when I display the error message, I would want to return false. And I don't know how to do it.
Here is what I have done (MyProgram is the name of my object).
I tried without the loop and with the Xpath constraint [attribute = $MyProgram/attribute] to test the existence of a program with the same name. It works perfectly, the only problem that I have now is that I would like to allow the user to retype a different value. Instead of that the creation of the object stops completly and we go back to the menu page.
How could I do this please ?
PS : I tried 2 ways, first by adding this microflow into an activity of the object creation microflow, and second by creating an event handler in the model before the commit. But in both cases I don't manage to do exactly what I want.