Is this the correct code - {% assign dued = Data.LinkData.duedays plus: 0 %} {{dued}} {%…
- User
Is this the correct code - {% assign dued = Data.LinkData.duedays | plus: 0 %} {{dued}} {% assign daya = Data.Workflow.a | plus: 0 %} {% assign dayb = Data.Workflow.b | plus: 0 %} {% assign dayc = Data.Workflow.c | plus: 0 %} {% assign dayd = Data.Workflow.d | plus: 0 %} {% assign daye = Data.Workflow.e | plus: 0 %} {% if dued == daya %} {{daya}} {% elsif dued == dayb %} {{dayb}} {% elsif dued == dayc %} {{dayc}} {% elsif dued == dayd %} {{dayd}} {% elsif dued == daye %} {{daye}} {% else %} Exception {% endif %} {% if dued == daya %} a days {% elsif dued == dayb %} b days {% elsif dued == dayc %} c days {% elsif dued == dayd %} d days {% elsif dued == daye %} e days {% else %} Exception {% endif %}
- Assistant
Yes, the code appears to be correct. It assigns the value of
Data.LinkData.duedaysto the variabledued, and then it assigns the values ofData.Workflow.a,Data.Workflow.b,Data.Workflow.c,Data.Workflow.d, andData.Workflow.eto the variablesdaya,dayb,dayc,dayd, anddayerespectively.It then uses conditional statements (
if,elsif,else) to check ifduedis equal to any of thedaya,dayb,dayc,dayd, ordayevariables, and if so, it outputs the corresponding value.Additionally, it also checks the condition of each variable and outputs the corresponding string if
duedmatches any of them. Ifdueddoesn't match any of the variables, it outputs "Exception".Overall, the code looks fine.