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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / addProperty - adding m...
Power Automate
Unanswered

addProperty - adding multiple properties at one time...syntax?

(0) ShareShare
ReportReport
Posted on by 678

In a select action I am doing...

 

addProperty(item(),'ProjectStatusId',xpath(outputs('XMLComments'),concat('//Array[ProjectId/text()="', item()['ReportId'],'"]/StatusId/text()'))?[0])

 

Right after I am doing another select to append a different property using the same xpath query but a different variable. The previous one appended "StatusId" and this one appends "PercentComplete". They are both referencing the same object where ProjectId value=item() ReportId.

 

addProperty(item(),'PercentComplete',xpath(outputs('XMLComments'),concat('//Array[ProjectId/text()="', item()['ReportId'],'"]/PercentComplete/text()'))?[0])

 


Can I combine these into one select ... I don't want to use the standard select where you map each property because I have alot of them - I only care about appending/adding these 2 properties.

Categories:
I have the same question (0)
  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    HI @sasrsc

     

    Was doing exactly what you were doing, and thereby had the exact same issue. Unfortuneately, I wasn't able to solve this in one action. 

     

    Solved it like this, with 2 arrays, which still have very good performance, but dosen't seem as smooth I guess. 

     

    Heartholme_0-1667311898206.png

     

    { If my post answered your question, please Accept it as a solution ✔ }
    { This will in turn help others find solutions to similar questions }

    Best Regards
    Heartholme

     

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    By the way, @sasrsc.

     

    I guess you watched @Paulie78  video on this as well. It might be that he can shed some light on if it's possible to get multiple properties in the same select. 

     

    Br

    Heartholme

  • sasrsc Profile Picture
    678 on at

    Yep, @Paulie78 provided the inspiration. I'd never done anything with xpath prior ... 

  • sree813 Profile Picture
    77 on at

    Hey @sasrsc, I was able to do it in my solution. Here are my two addproperty values which is converted in to single expression.


    addProperty(item(), 'fine_band', xpath(xml(outputs('XML')), concat('//Array[transaction_id/text()="', item()?['transaction_id'], '"]/fine_band/text()'))?[0])

    addProperty(item(), 'transaction_reference', xpath(xml(outputs('XML')), concat('//Array[transaction_id/text()="', item()?['transaction_id'], '"]/transaction_reference/text()'))?[0])


    Single Expression:

    addProperty(addProperty(item(),'fine_band',xpath(xml(outputs('XML')), concat('//Array[transaction_id/text()="', item()?['transaction_id'], '"]/fine_band/text()'))?[0]),'transaction_reference', xpath(xml(outputs('XML')), concat('//Array[transaction_id/text()="', item()?['transaction_id'], '"]/transaction_reference/text()'))?[0])



    Hope this helps you.
    Thanks.



     

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!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 239 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 177 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 97 Super User 2026 Season 1

Last 30 days Overall leaderboard