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 / HELP: IF statement ref...
Power Automate
Answered

HELP: IF statement referencing table cell content does not work

(0) ShareShare
ReportReport
Posted on by 11

Hello all.

Question from a newbie.

I want to use an IF statement to have 2 different flows depending on the value of a cell from Excel.

I have set a variable "WebSources"

Basil58_0-1668595699486.png

I am trying to run an IF statement:

Basil58_1-1668595822580.png

Any help will be appreciated.

I have the same question (0)
  • Verified answer
    Siddhi_N Profile Picture
    27 on at

    Hi @Basil58 

    The first operand of if statement should be %WebSources[0]%.

    Please refer below article for more details on accessing list/table values

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#list

     

     

  • Basil58 Profile Picture
    11 on at

    @Siddhi_N ,
    You are awesome!
    Thank you! 

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    In the future, I recommend using the Switch->Case function for this scenario. This is used to basically, If my variable is 1, do A, if 2, do B, and if none of those, do something else.  It allows for logic that sometimes can’t be handled by if’s or nested if’s. It goes in order of cases from top to bottom and once it hits a match, it does what it is told for that match and then gets out, whereas subsequent if statements are still assessed. 

    example:

    Set variable %choice% to 3

    Switch on %choice%
        Case 1

             Rub Subflow 1

        Case 2

             Run Subflow 2

        Case 3

            Run Subflow 3

    End Switch

     

    this would run Subflow 3, but if you replaced set variable with logic to define the variable, you could run other subflows based on the result of %choice% such as an input dialog box. 

    best of luck!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 1,005

#2
Valantis Profile Picture

Valantis 825

#3
Haque Profile Picture

Haque 619

Last 30 days Overall leaderboard