web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating if statement ...
Power Automate
Answered

Creating if statement expressions

(0) ShareShare
ReportReport
Posted on by

I would like to make an expression but am unsure how to 

I would like it to be an if statement of sorts. I'm pulling data from powerapps, including an item called "NA smoking another"

This will produce either a "true" or "false" result. 

I'm populating a word docx with checkboxes, and one of the methods was to make a variable and insert it (i have confirmed this works). 

How would I write an expression where in which if the "NA smoking another" is true, then initialise variable will be inserted into the word output (eg in Dose 12 row), if not then initialise variable 2 will be inserted into the word output (eg in dose 12 row)

Any advice on building this would be greatly appreciated

 

 

Power1231_0-1691040082132.png

Power1231_1-1691040225669.png

Power1231_2-1691040244666.png

 

 

Categories:
I have the same question (0)
  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey Mate,

     

    You can use the If expression to validate the data. You can also it pass the correct data in your Word template 

     

    if Returns a specific value if the expression results in true or false. This expression returns "yes":
    if(equals(1, 1), 'yes', 'no')

     

     

     

     

    You can find more details in the video - https://www.youtube.com/watch?v=1T1sBPpVOj0

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • Community Power Platform Member Profile Picture
    on at

    Hey Mate, Yeah i want the if statement to pass on data

    My query was moreso on how would i write the expression i was talking about: 

    How would I write an expression where in which if the "NA smoking another" is true, then initialise variable will be inserted into the word output (eg in Dose 12 row), if not then initialise variable 2 will be inserted into the word output (eg in dose 12 row)

    I was thinking something along the lines of If(NA Smoking another="true", variable 1, variable 2)

    However, i dont know how to write it viably such that powerautomate can process that as it keeps prompting saying "the expression is invalid"

  • Verified answer
    CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @Anonymous 

     

    Something like this? 

     

    if(equals(triggerBody()['boolean'],true),variables('Variable1'),variables('Variable2'))

     

    CFernandes_0-1691046267751.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard