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

Expression works for my flow, but not colleague 

(0) ShareShare
ReportReport
Posted on by 42
I have some code that someone helped write. It works great for my flows, but my colleague is unable to get it to work.
 
I've duplicated everything down to using the same file for input and it still fails. I'm not sure what the problem is, but I'd like to see if it's possible to rewrite this to simplify the process and ensure others can use my flow with the code. I've looked at some examples in copilot and I don't fully understand what it is suggesting I change it to. 
 
The purpose here is to concat unique email addresses from column 2 (TeamAlias) to the email address from column 1 (Owner). 
 
My flow actions: Steps 1 to 3 all work fine. 
  1.  List rows in Excel
  2.  SelectOwner
    1. From: Outputs list rows present in a table
    2. Map: Owner
  3. Compose data operation
    1. union(body('SelectOwner'),body('SelectOwner'))
  4. Apply to each (code below)
 
Code: 
union(
union(json(string('[]')),
xpath( xml(json(concat('{"root":{"item":',outputs('List_rows_present_in_a_table')?['body/value'],'}}'))) , concat( '/root/item[Owner="',items('ApplyToEach'),'"]/TeamAlias[ normalize-space(text()) != " " ]/text()'))) ,
createArray(items('ApplyToEach')))
 
Error: 
Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'xpath' parameters are invalid: the 'xpath' parameter must be a supported, well formed XPath expression.
 
Note: I don't know if this is relevant, but I am using the old designer view, while my colleague is on the new. 
 
 
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    52,323 Super User 2025 Season 2 on at
    Expression works for my flow, but not colleague
     
    To start, yes, tell them to swap to the old one just to verify and it probably will work.
     
    But as for what you are doing, I am not sure I completely understand. 
     
    You sounded like you wanted to do this:
     
    1. Get the unique email addresses from 2
    2. Loop through them
    3. For each Row in the (step 2 of your flow) where email column 2 = the current item in your email unique iteration (apply to each)
    get the rows and then concat the current iteration value of email with the value of Column 1 
     
    Is that correct?
     
    I am not sure what you are doing with it afterwards, but I do not recommend using Xpath for this at all as its bloated and not beneficial when you are talking about excel, but I really want to be clear, what you are doing with the list afterwards because you can simply use a select and do what I think you want, I am just not sure it is what you want.
     
    But imagine this
     
    You do a Filter Array to get out the rows from Step 2 where the email column 2 = current iteration
    Then an advanced select where you just concat (row 1 with the value of the iteration)
     
    Heck you can probably just do it with an array and a select even faster.
     
    How many rows are we talking about?
     

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • RolloV Profile Picture
    42 on at
    Expression works for my flow, but not colleague
    Hi Michael,
    Yes you got it right. For each row we need to concat those unique email address from TeamAlias to the owner's. Sample table below.
     
    RowID Owner TeamAlias
    1 Person1; Team1;Team2;
    2 Person1; Team1;Team2;Team3;
    3 Person2; Team5;
    4 Person2; Team6;
     
    I am using this list to enter into the To: line for sending an email. 
     
    Result:
    1. Person1;Team1;Team2
    2. Person2;Team5;Team6
    As a side note, I asked them to share the flow with me. I edited it to duplicate all my settings, then ran it in my environment using the old designer. It still fails when I try it. I'll ask them to switch and give it a quick try. 
     
    The data isn't very big, around 100 to 200 rows. There could be situations though where we've got 10k-50k rows.
     
    How are you suggesting using a Select to get the unique email addresses in the second column?
     
    I don't have any actions to clean the data in either column to ensure this all works. The user is forced to enter email addresses in the proper format with a semicolon (;) delimiter. This is probably better served being handled in Excel Data Model by each user. 
     
    Thank you

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

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

#2
Tomac Profile Picture

Tomac 348 Moderator

#3
developerAJ Profile Picture

developerAJ 262

Last 30 days Overall leaderboard