05-12-2021 09:19 PM
Hello Team
how we can use if else condition in xml generator snap
here is my query
here either Expt have value or Sco have value not in both (Expt,Sco)
i want to display
case 1)if vatPer = 0.0 and if Expt tab have value then display Expt tab
expecting like this
case 2)if vatPer = 0.0 and if Sco tab have value then display Sco tab
can you please help
Thank you
05-13-2021 07:16 AM
I believe this is what you are asking for. The attached pipeline uses Apache Velocity to handle the if-then-else logic to output the appropriate containers in the xml. I created an array of objects to show both the 0.0 and non-zero case, which allowed me to also demonstrate for-loop logic to loop through the array contents.
XML Generator if-then-else_2021_05_13.slp (5.1 KB)
05-13-2021 11:29 PM
Hello Koryknick
Thank you for reply
But still its not resolve my issue , my expectation is like this if xml input is
case 1) if xml input is then output should be
Case 2 ) if input is then output should be
Case 3 ) if input is then output should be
Thank you
05-14-2021 01:27 AM
Hey @Mahesh7225 ,
I made some adjustments on the @koryknick’s pipeline and I belive that this is what you was looking for,
XML Generator if-then-else_DELETE_2021_05_14 (1).slp (5.3 KB)
Try and manually adjust cases in the JSON Formatter one by one.
Best Regards,
Bojan