Skip to main content

Notifications

Power Automate - General Discussion
Answered

Email Output from SharePoint from choice column

(0) ShareShare
ReportReport
Posted on by

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. 

 

Categories:
  • Re: Email Output from SharePoint from choice column

    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')))}

     

     

  • Verified answer
    v-yamao-msft Profile Picture
    v-yamao-msft on at
    Re: Email Output from SharePoint from choice column

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

    1.PNG2.PNG

     

    Please take it for a reference and try again with it.

     

    Best regards,

    Mabel Mao

  • Re: Email Output from SharePoint from choice column

    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?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard