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 / How to change properti...
Power Automate
Unanswered

How to change properties of object in bulk?

(0) ShareShare
ReportReport
Posted on by 29

I've set an entity inside a loop with many properties.

entity = {id:1, name:link, date:20201111, note:'',...}

 

I must use the 'setProperty' method to assign a value to each property.
My process now looks like this, which is uncomfortable to read

 

 

for (list) {
// reset entity
set(var(entity), json(id:'',name:'',...))

// set entity
setProperty(var(entity),key,val)
setProperty(var(entity),key,val)
setProperty(var(entity),key,val)
setProperty(var(entity),key,val)
setProperty(var(entity),key,val)
setProperty(var(entity),key,val)


Add a row into a table{
 file:...,
 table:...,
 row:var(entity)
}

.... 
}

 


Is there a way to assign values in bulk?
or you can merge these assignment statements into a single statement?

 

Categories:
I have the same question (0)
  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    Yes, you can just write a compose and define the whole thing in one step. Here is one like it in one of my flows:

    composeObject.PNG

    Does that make sense?

  • xlzs Profile Picture
    29 on at

    Yes, this is what I was hoping for.

    Thank you!


    There may be a problem with my json splicing, I used to use the json function to convert the string to set the value.
    It's horrible to write.😅

    json('{
    "name":"link",
    "age":' + items('getAge') + ',' +
    '"item":' + .....,
    }')
    
    // or use json(concat( ... ))

     

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard