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 / Using conditions in my...
Power Automate
Unanswered

Using conditions in my flow

(0) ShareShare
ReportReport
Posted on by 22

Hello,

 

I am trying to automate the following and am getting stuck. I am currently keeping track of completions of a module I have created with an MS Form. I have a flow set up to pull needed information from the Form into an Excel Table, one piece being the office location of the person who completed the module. What I would like to do is when I go to this table, to be able to trigger a flow to send an email based on a condition. If the office location does not appear anywhere else in the column, then it will send one email. If the location is already present (someone from that office has completed the module), then a different email will send.

 

I have the trigger has For a Selected Row in Excel. I think I need to use the Filter Array and then Condition steps, but am not sure what to input in these steps.

 

Any help would be greatly appreciated! I'm still new to Power Automate and don't have all of the formulas and steps down yet.

 

Thank you!

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    @condotma ,

     

    You can set up a manual trigger or a recurrence trigger (maybe once daily) if you want it to run automatically.

    Do you have a finite list of locations somewhere that you can compare against?

    What you want is simple

    Loop through all the locations (from master list)

    Query the Excel table where the Location field matches the location

    SudeepGhatakNZ_0-1679022129626.png

     

     

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @condotma 

     

    So you want to send email based on row you have selected right ?

  • condotma Profile Picture
    22 on at

    Hi @Nived_Nambiar,

    Correct. It’s based on the row selected. 

    Thanks,

  • condotma Profile Picture
    22 on at

    Hi @SudeepGhatakNZ,

     

    thanks for the suggestion. I want the flow to check against the other entries generated in the table. Would checking against a master list be necessary?

     

    Thanks,

  • Verified answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @condotma 

     

    You can try this way

     

    For demo, I have created an excel file which looks like this

    Nived_Nambiar_0-1679055639779.png

     

    1. Use the trigger for a selected row

    2. Next use the list rows in table, inside that specify all file details and in the filter query section specify a condition

    Nived_Nambiar_1-1679055674039.png

     

     

    where the variable office location is coming from selected row trigger, here this query is trying to filter the rows based on rows having officelocation column value equal to the value of officelocation of selected row.

     

    3. Next use an if condition with condition as 

    length(outputs('List_rows_present_in_a_table')?['body/value']) = 1 
    Nived_Nambiar_2-1679055888609.png

     



    outputs('List_rows_present_in_a_table')?['body/value'] represent the rows as output from list rows in table after filtering using filter query.
     
    if the condition is true, then it means that officelocation for selected row doesn't appear anywhere in the column
    else, it appears somewhere else.
     
    Hope this logic would help in building the flow 🙂
     
    Flow complete picture
    Nived_Nambiar_3-1679056000065.png

     

  • condotma Profile Picture
    22 on at

    Hi @Nived_Nambiar,

    Thank you! This makes sense and it gets my flow to run!

    However, it only runs the No condition, even if I only have 1 of that location in the table. 

    I took some screenshots of the flow...am I missing anything or did I input anything incorrectly?

    Screen Shot 2023-03-17 at 10.30.48 AM.pngScreen Shot 2023-03-17 at 10.30.23 AM.png

     

    Thank you!

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    The way you have inserted the length function is wrong , check the above screenshot on how i have done it.

     

    Nived_Nambiar_0-1679064034454.png

     

  • condotma Profile Picture
    22 on at

    That makes sense! In the body/value section of the length function, am I inputting the column name?

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Length function is used to calculate length of array here 

    outputs('List_rows_present_in_a_table')?['body/value'] is an array of rows, so length of this would be equal to number of rows obtained from list rows from table action and if you remember we have used filter query to filter only the rows which has officelocation equal to the selected office location value in list rows from table action.

    So in short, list rows from table gives u the rows whose office location column would have value equal to selected row office location value and length of that gives how many rows are there.

     

    Hope all is clear now.

     

  • condotma Profile Picture
    22 on at

    Hi Nived,

     

    Thank you for the explanation. It does make sense to me now.

     

    In the yes and no step. I would like to send a different email based on the result. So if it is unique, one email is sent. If it is a duplicate, another email is sent. 

    Do I require to use to those Compose actions or can I just insert the send an email action?

     

    Thank you for all of your help thus far. It is greatly appreciated!

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard