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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to add properties ...
Power Apps
Answered

How to add properties to a localVariable?

(0) ShareShare
ReportReport
Posted on by 23

Hi, OnSelect of a Button I have the next code

 

UpdateContext({locDocument:MyPowerAutomateFlow.Run()})

 

 that code creates a context variable called locDocument it returns some properties from the flow like these

 

{
"name":"foo",
"id":"12234",
"base64":"SG9sYU11bmQ="
}

 

so I am able to use  in my app like locDocument .base64 or locDocument .id and so on. but I need to add more properties to that object (locDocument )

 

{
"name":"foo",
"id":"12234",
"base64":"SG9sYU11bmQ=",
"extra1":1,
"extra2":"string"
}

 

those extra properties are not handle by the MS Flow.

What can I do? thanks

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,657 Most Valuable Professional on at

    What do you mean those properties are not handled by MS Flow?  Are you referring to the issue with Respond to Power Apps trying to return a number?  Or just that the other properties aren't available in Flow?

     

    You can't add more properties to the existing Context variable.  But you can create a new one that contains those properties and additional ones.

     

  • Abhilash_Swain Profile Picture
    901 on at

    @JesusPrim @If you are looking to add columns to locDocument, you can use AddColumns(please check the syntax).

     

    If you are looking for your Flow's return value should contain these extra columns, then you need to adjust the flow . So that in return it will provide you those extra columns.

     

     

  • TerryShowman Profile Picture
    23 on at

    @Pstork1 @Abhilash_Swain Hi thanks for reply. The flow just return 2 properties and thats it. it wont return more properties because aren't available in the MSFlow.

    I've done something like this, it works but i think I'm doing the things wrong.

    UpdateContext({locDocument:{
     response:MyPowerAutomateFlow.Run(),
     extracontent:{extra1:1,extra2:"foo"}
     }
    });
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @JesusPrim

    There is no easy way to add within Powerapps. We can do some splitting the response into the collection (A more tedious process), Add columns to add more properties, and to JSON.

     

    The best approach is to send to another Power automate (It's easier in Power Automate). Which combines or add more properties. Get response as full JSON back.

  • Pstork1 Profile Picture
    69,657 Most Valuable Professional on at

    Unless you want to create a separate Context Variable that is the best way to add additional values to locDocument.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard