Expand my Community achievements bar.

Multiple ifs not working

Avatar

Level 1

In the below module #11, I am read the request meta data.

PujaSi1_0-1734678684650.png

And I am using these meta data in module # 59 (set variable) with IF statements

PujaSi1_1-1734678863541.png

 

I am expecting the output of the module as "1" in the 1st operation and "2" in the 2nd operation and "3" in the 3rd operation as per the values captured in the module#11.

 

But output of the module#59 is always the first value for all operations and ignoring the subsequent values. In this example, please refer the module #59 output in the below screenshot,

PujaSi1_2-1734679256425.png

 

Help me to write the correct "If statement" in the module #59

6 Replies

Avatar

Level 8

In your case, the "or" operator will always return the first value, which is DE:Version Count 1 or 0.

For example, your formula returns 1 or 2 or 3, so the system will just take the first value because of the "or" operator.


You'll need to tweak your approach.

Avatar

Level 8

I think the best approach is to create separate variables for each tactic group, if you want to get results separately (depends on what you are trying to get).

Avatar

Level 1

Thanks Manish for the response. I've stored the tactic group as separate variables but it does not resolve my problem. I think the right "multiple if" condition in the module #59 should work, any thoughts please?  

Avatar

Level 8

I was suggesting something like this, it would be three variables:

versionCount1: if(DE:Tactic Group 1 = SMS; DE:Version Count 1; 0)
versionCount2: if(DE:Tactic Group 2 = SMS; DE:Version Count 2; 0)
versionCount3: if(DE:Tactic Group 3 = SMS; DE:Version Count 3; 0)

Does the tactic group 1/2/3 field always have a value? Also, I'm not sure what module you added before 59, so I can't point you to the solution.

 

Avatar

Level 1

Thanks again for your time Manish!

 

Tactic group 1/2/3 and version count 1/2/3 wont always have value and that's why I have the read record module #11 to fetch them anyway. Tactic group count and version count is based on the number of choices chosen in custom field prior using display logics. 

 

PujaSi1_0-1734705328700.png

 

Now I've created versionCount1, versionCount2 and versionCount3 but here the problem is I need that as a single variable to be used in the subsequent repeater module #37 to create tasks in Workfront project. In short, based on the number of choices given in the "version count" custom field, that many sub tasks should be created in Workfront project under that tactic task. Please shed some light on this variable and repeater module if you have any thoughts. 

PujaSi1_2-1734705699781.png

 

Finally the task creation module,

PujaSi1_3-1734705882863.png

 

Avatar

Level 8

"Now I've created versionCount1, versionCount2 and versionCount3 but here the problem is I need that as a single variable to be used in the subsequent repeater module #37 to create tasks in Workfront project."

Could you please clarify the single output you expect if versionCount1, versionCount2, and versionCount3 are 1, 2, and 3 respectively?

Additionally, it would be helpful if you could share the blueprint or a screenshot.