Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Flow from rows from a table

(0) ShareShare
ReportReport
Posted on by 901

Hi,

I find it difficult to explain wat i want to do but I still try.
I also have an example of what I have made now, but it does not do what I want that is to do.

 

I want to create a Flow that looks at a table.

For every line where column B is 2019 (this year) AND column C is period 4 (previous period) AND has a 1 in a ruleset, an email is sent where i in the body a choice can be made.

 I hope sombody can help me☺

 

Like As:
1001 = 2019 + 4 (column A + B + C)
Has a 1 with ruleset1 and has a 1 with ruleset 3
Then in the mail (Body) column A + B + C and column L + M + R AND column W

 

This is the table:

Flow2.png

 

This is the flow for so far but it is very bad i think.

Flow1.png

  • frixel Profile Picture
    901 on at
    Re: Flow from rows from a table

    hi @efialttes 

     

    can you help me to solve the last part?

    I cannot figure out what to enter in this line.

    Do I enter this exactly like this? if (equals (item ()? ['Ruleset_1'], '1'), concat ('This text is added when ruleset_1 equals to 1:', add (add (int (item ()? ['Number']) , int (item ()? ['Year'])), int (item ()? ['Period']))), '')

    or must i set something else with the parts ['Number'] ['Year'] and ['Period']?

     

     

  • frixel Profile Picture
    901 on at
    Re: Flow from rows from a table

    Hi @efialttes 

    Oh dear i make indead a mistake.

     

    example: store 1001 (mail is 1001@mail.com) Has a 1 with ruleset1 and has a 1 with ruleset 3

    Then in the mail (Body) custom text and result from column A + B + C(=linked to ruleset1) and custom text and result column L + M + R(=linked to ruleset2) 

    Ruleset 1 is linked to colum N+O+P

     

    In your example you mean that the expession is exacly as here or must i changed it?

    if(equals(item()?['Ruleset_1'],'1'),concat('This text is added when ruleset_1 equals to 1 : ',add(add(int(item()?['Number']),int(item()?['Year'])),int(item()?['Period']))),'')

     

    When i fil it so in the expression the Flow fails.

     

    Flow1.png

     

     

  • efialttes Profile Picture
    14,756 on at
    Re: Flow from rows from a table

    @frixel 

     


    example: store 1001 (mail is 1001@mail.com) Has a 1 with ruleset1 and has a 1 with ruleset 3

    Then in the mail (Body) custom text and result from column A + B + C(=linked to ruleset1) and custom text and result column L + M + R(=linked to ruleset2) 

    in order to add the number value stored on columns A, B, C you can invoke twice the add() function since it only accepts two arguments:

    add(add(int(item()?['Number']),int(item()?['Year'])),int(item()?['Period']))

     

    You can combine it with concat() and if() funtions to display additional text dependant on an evaluation rule:

     

    if(equals(item()?['Ruleset_1'],'1'),concat('This text is added when ruleset_1 equals to 1 : ',add(add(int(item()?['Number']),int(item()?['Year'])),int(item()?['Period']))),'')

     

    I am assuming Column A is 'Number', column B is 'Year' and column C is Period' but I guess you are referring to other columns. Please note I am using int() in order to ensure texts are translated into numbers.

     

    You can add a similar expression to evaluate if ruleset_3 is 1 and if so print a text and the sum of L, M, and R

     

    But the next rule in tje Excel table store 1002 has example ruleset 3

     

    I hope you understand what I mean.

     

     


     

  • frixel Profile Picture
    901 on at
    Re: Flow from rows from a table

    Hi @efialttes .

     

    Like As:
    example: store 1001 (mail is 1001@mail.com) Has a 1 with ruleset1 and has a 1 with ruleset 3

    Then in the mail (Body) custom text and result from column A + B + C(=linked to ruleset1) and custom text and result column L + M + R(=linked to ruleset2) 

    But the next rule in tje Excel table store 1002 has example ruleset 3

     

    I hope you understand what I mean.

     

     

  • efialttes Profile Picture
    14,756 on at
    Re: Flow from rows from a table

    @frixel 

    You can forget the "Compose" action block, I add it for troubleshooting purposes

    Since "Condition" action block does not show you the evaluation result of each independent rule, but the overall result, I add each input and each evaluation expression inside a Compose action and this way I can easily inspect them. As I said, very useful for troubleshooting purposes.

     

    REgarding email text, not sure I understood your requirements:


     

    My next step is to adjust the Flow because there must be a different text in the mail for each rule set.

    It is therefore possible that the mail should contain text from either ruleset1 and ruleset3 or ruleset1 and ruleset4.(depending on where the 1 is in the rulesets)


    You mean you want to show a different text depending on which ruleset is set to 1?

    Can you provide 3-4 examples from the excel you shared? I mean row-> expected text

    Hope this helps

  • frixel Profile Picture
    901 on at
    Re: Flow from rows from a table

    Hi @efialttes 

    Okay, great now I come a long way.
    I just wonder why you also have a "compose" in it?

     

    My next step is to adjust the Flow because there must be a different text in the mail for each rule set.

    It is therefore possible that the mail should contain text from either ruleset1 and ruleset3 or ruleset1 and ruleset4.(depending on where the 1 is in the rulesets)

  • efialttes Profile Picture
    14,756 on at
    Re: Flow from rows from a table

    @frixel 

    I think we got it!

    Edit the condition, and instead of 2019 use the following expression:

    string(2019)

     

    flow_excel_3.png

    You need to do the same with:

    4 -> string(4)

    1 -> string (1)

     

    The reason for this is the following: when flow reads the Excel rows, it is most likely considering their column values as strings (text) instead of integers (numbers). So we need in the evaluation rules to compare to strings.

     

    I did some testing by myself replicating your excel (I simplified it a bit, but the concept is the same), and it works!

    flow_excel.png

     

    So this is the first iteration output:

    flow_excel_4.png

    And this is the second iteration output:

    flow_excel_5.png

     

    Please also note you do not need the "Get row" action block if you select the condition evauation entries in this way:

    flow_excel_2.png

  • efialttes Profile Picture
    14,756 on at
    Re: Flow from rows from a table

    @frixel 

    Thanks for shareing the info. On your screenshot you will see 8 iterations occur (your excel table has 8 rows, right?), and since the icon on the top right corner is in green, all of them succeded (meaning no execution error occured).

    If no email was sent, this is because the flow evaluated the condition 8 times but all of them returned false.

    From your previous posts it seems that at least one of the rows should return true, so let's see if we find the problem.

    Can you open the editor and share a screenshot on how you defined "Get a row" inputs?

    Also, in the same editor, how did you define the condition? I mean, did you use the outputs of "Get row"?

  • frixel Profile Picture
    901 on at
    Re: Flow from rows from a table

    No, sorry, I don't understand.

    I apologize for keeping you working.

    The condition is that there is a 1 in a ruleset and so he must send the mail.

     

    Flow4.png

  • efialttes Profile Picture
    14,756 on at
    Re: Flow from rows from a table

    Hi

    On the same screen you shared to me (the one that shows last execution results) you can verify the number of iterations (that is, the number of rows evaluated) in the "Apply to each" action block:

    flow_iteration_inspection.png

     

    Whenever any of the iterations fail, you will see a red icon on top right of the "Apply to each" action block. If all iterations succeded, then this icon will turn green.

    You can inspect the iteration result one by one, just click on "Next>".

    In the iteration example you shared, execution succeded. However, no email was not sent for that row because the evaluation of the condition returned 'false'. You can inspect the iterations one by one and verify if condition evaluation from any of the iterations returned 'true'. If so, then one email should be sent per iteration whose condition returned 'true'. If ten rows evaluation returned true, then 10 emails sent. If 0 rows evaluation returned true, then 0 emails sent.

    Hope this helps

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow