Xpath Statement in a Microflow Decision

0
Hi all, I am trying to use a Decision to determine if a record already exists before I create a new object. I am trying to use count(//ParentEntity/has/ChildEntity[Name = $LoopedObject/Name])>0 as an expression in a Microflow decision and was hoping it could work, What’s wrong? Thanks!
asked
2 answers
1

XPath in a Desicion does not go to that length. But let Mendix do the work for you. If you do a retrieve-activity followed by a count-activity into for instance “numofrecords”, then this will result in only one database call. Then you can follow with a Decision which is just checking $numofrecords > 0.

Something like this:

 

answered
2

Hi!

I guess, 'isNew()' can be used in split which will return a boolean value whether the object already exists in DB or not. 

Hope this helps your requirement! Thanks.

answered