Forum Discussion

Mahesh7225's avatar
Mahesh7225
New Contributor
5 years ago

How to use if else condition in xml generator snap

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

3 Replies

  • 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)

    • Mahesh7225's avatar
      Mahesh7225
      New Contributor

      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