Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Updating in memory JSON Object properties in Flow

(0) ShareShare
ReportReport
Posted on by 107

Hello together

I need to analyze data with a Power Automate Flow. The flow will be very extensive. To be able to manage intermediate results per analyzed record in the flow, I thought about defining a JSON object as follows:

 

{
 "TotalTasks": 0,
 "OcrLabels": 0,
 "NotValidated": 0,
 "NOk": 0,
 "UTD": 0,
 "Ok": 0,
 "OverwriteUser": 0,
 "NotAvailableUser": 0,
 "OkSupervisor": 0
}

 

Above JSON Object is stored in a Variable called 'Validation'.

Now I want to access individual properties of the object at any point in the flow and, for example, increase the value by +1 or subtract -1, summarize intermediate some values, and so on... For increasing a property value by 1 I currently use the following line in a Compose Task:

 

setProperty(variables('Validation'), 'TotalTasks', add(variables('Validation')['TotalTasks'], 1))

 

In order for the value to be effectively stored in the object, I have to append a Set Variable Task after each Compose Task. If I want to update two values, I cannot append a Set Variable Task after the second Compose Task. No, I have to do a Set Variable directly after each Compose Task. This makes the flow extremely slow.

Is there a better solution to cache and edit data in the flow without having to store it in a DB or SharePoint or File?

  • v-bofeng-msft Profile Picture
    on at
    Re: Updating in memory JSON Object properties in Flow

    Hi @Aedu ,

     

    Because a variable do not support referencing itself at the same time in 'Set', I'm afraid we can only add a 'Compose' before the 'Set'. In addition, you can consider replacing object variables with multiple int variables, and then using increase and decrease actions.

     

    Best Regards,

    Bof

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492