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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Concat values from multiple rows in

(0) ShareShare
ReportReport
Posted on by 356

Here's the scenario, I've built an Expense report App using PowerApps , that's using SQL Server as the DB. Each Expense Report can have multiple Expense line items and each expense line item could have a different person approving that particular line item.

 

I'd like to send out an E-mail  for each Expense Report to all the approvers (one for each line item) that have not yet approved the specific line item.

 

While I've already done all the filtering etc. What I need help with is as follows:
1. Send one e-mail for each expense report

2. Create a string of distinct approvers for each expense report

 

So that I can get an e-mail for each Expense Claim, addressed to each of the unique approvers for all the line items in the Expense Report.

 

Any help would be greatly appreciated.  

I have the same question (0)
  • efialttes Profile Picture
    14,756 on at
    Re: Concat values from multiple rows in

    Hi!

    "While I've already done all the filtering etc. "

    Does it mean you already have a draft Power Automate Flow designed? I mean, at least the trigger and the first action blocks? If so, can you share a screnshot from youtr current design so we can get a more accurate idea on how we can help you?

    Thanx!

  • UB400 Profile Picture
    356 on at
    Re: Concat values from multiple rows in

    FlowScreenShot.jpg@efialttes nothing much to see at the momment. I'm just playing with the proof of concept, trying to understand the best way to get this done. At the moment I'm just using a button trigger, but I will eventually change to a scheduled trigger as I would need the Flow to run once everyday. Once I have the proof of concept working, I can flesh out the rest of the Flow.
    Essentially as you will see in the image, I have Get Rows action nested in another, the 1st one or the "enveloping one" gets all rows that meet a certain criteria, and within that there is an apply to each, which contains another Get Rows action which retrieves the line items associated with each claim being looped through.
    Where I'm stuck, is trying to concat the value of the approvers column from the line items, so that I can have them in a string e.g. joe@abc.com; jane@abc.com; so that I can send the approvers an e-mail reminding then that they need to review these items. Let me know if you need further info on the scenario. Thanks for looking.
     

  • efialttes Profile Picture
    14,756 on at
    Re: Concat values from multiple rows in

    Hi again

    "Where I'm stuck, is trying to concat the value of the approvers column from the line items, so that I can have them in a string e.g. joe@abc.com; jane@abc.com"

     

    If your output has one column per approver email, there are several approaches: concat(), createArray() and join(), etc all of them based on expressions and WDL funtions

    But it is difficult to say without an example.

     

    Can you share an example of line item output as displayed in your Flow execution, so we can understand better your challenge?

     

    Thanx!

  • UB400 Profile Picture
    356 on at
    Re: Concat values from multiple rows in

    @efialttes  I've simplified things a bit. I'm now using "Get Rows from SQL" to bring in rows from a SQL View.

    Essentially now I just have two columns, the "ID" column and an "Approver" Column (contains e-mail address).

    Below is an image of part of the body of the Get Rows action

     

    PendingApprovalLineItems.jpg

     

    I found this blog by John Liu https://john-liu-ppph.squarespace.com/blog/2018/6/do-group-by-in-flow-with-two-simple-elegant-loops and I tried to use the union in a Compose action union(variables('TA'),createArray(item()?['TAID'])) but that doesn't work, output is blank.

    So at the moment not really getting anywhere, any help is most welcome.

  • efialttes Profile Picture
    14,756 on at
    Re: Concat values from multiple rows in

    Hi

     

    Can you share a screnshot of your current flow design, displaying also input details, so we can see the input where you placed the union() based expression?

    Just doublecking on each action block, so it will expand and we will be able to get a more clear picture

     

    Thanx!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard