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 modify/add a Ta...
Power Apps
Answered

How to modify/add a Table entry?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Say, I create a Table in a global variable via: 

Set(MyTable, Table({Name: "John", Age: 30}))

 

Question 1: How do I modify the age of John? Following doesn't work at all, nor did Patch()

UpdateContext({MyTable: {Name: "John", Age: 32}})

 

 

Question 2: How do I create a new entry if a person does not exist? (Name here acts as an UID)

UpdateContext({MyTable: {Name: "Tim", Age: 19}})
Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    @Berat-Cakir 

    It's not possible to update and modify the items in a table variable in the way that you want.

    Unless there's any specific reason for you to use a table variable, it would be easier for you to store the values in a collection.

     

    Here's how to create the collection: 

    ClearCollect(colYourTable, {Name: "John", Age: 30})

     

    Here's how to update a record:

    UpdateIf(
     colYourTable,
     Name="John",
     {Age:32}
    )
    

     

    Here's how to add a new record:

     

    Patch(
     colYourTable,
     Defaults(colYourTable),
     {Name: "Tim", Age: 19}
    )

     

     

  • Berat Cakir Profile Picture
    Microsoft Employee on at

    Many thanks! That would work too 🙂

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 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard