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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to use Conditional...
Power Automate
Unanswered

How to use Conditionals in Set Variable

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Is it possible to set an IF statement inside of the Set Variable function? For example:

 

IF (something == something) THEN variable=something ELSE variable=somethingelse

 

Or would I need to manually create the IFs and ELSEs?

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Need to do it the other way around.  Put the Set Variable Function in the IF Function.  If you have only 2 options, use IF.  If you have more than 2, use Switch and Case.

    Here is another Switch screenshot I made, but you can easily replace Focus Window with Set Variable:

    MichaelAnnis_0-1628794150440.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard