I am trying to do somthing simular to this post I had previously with a a toggle, but now I have a drop down of three options of Yes, No, and Not Applicable using the following code of many variations but I keep getting an error.
<td style="width: 228px;">@{if(equals(triggerBody()?['OData__x0044_S1']?['Value'],'Yes','No'),'Yes','No','Maybe' )}</td>
I think once I get this working I can apply the inline style like I did before.
I see what you did there nice! I had to do the following to get this to work in an email for anyone else that reads post.
@{if(equals(triggerBody()?['OData__x0044_S3']?['Value'],'Yes'),'Yes',if(equals(triggerBody()?['OData__x0044_S3']?['Value'],'No'),'No',if(equals(triggerBody()?['OData__x0044_S3']?['Value'],'Not Applicable'),'Not Applicable','Not Applicable')))}
Hi @Anonymous,
It seems that when there is a space or special character for the output, the code you are using will return an error.
I have made a simple test with the following code, though there is a space for the output, it still works fine. The code is:
if(equals(triggerBody()?['Choice']?['Value'],'Yes'),'Yes',if(equals(triggerBody()?['Choice']?['Value'],'Not Applicable'),'Maybe','No'))
Please take it for a reference and try again with it.
Best regards,
Mabel Mao
I managed to get this working if I don't have spaces or special charaters like this.
@{if(equals(triggerBody()?['OData__x0050_AC6']?['Value'],'ABC'),'Yes','No')}
If I do it like this it will not work
@{if(equals(triggerBody()?['OData__x0050_AC6']?['Value'],'ABC - 123'),'Yes','No')}
I tried encoding it, but that did not work either.
@{if(equals(triggerBody()?['OData__x0050_AC6']?['Value'],'ABC%20-%20123'),'Yes','No')}
If we get this working will I have the same issues if I put a space or special character for the output?