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 can I patch to var...
Power Apps
Answered

how can I patch to variable that contains the list name/ collection name

(0) ShareShare
ReportReport
Posted on by 6

is there way to patch to variable that contains the name of list or collection

 

example

Patch (employee,{

                    ID:test

                    }

    )

 

vs

 

Set(var, "employee");

Patch (var,{

                    ID:test

                    }

    )

Categories:
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    No, this is not supported. Power Apps requires that the types of the arguments to most of its functions to be compatible. In the case of Patch, it checks that the column ID (like your example) exists in the collection that you are trying to Patch. This cannot be done from a variable that is set when running the app - it may be set to a collection that doesn't have such column, or even to the name of a collection that doesn't exist.

     

    If you know which collections you will want You can use something like the expression below:

    Switch(var,
     "employee", Patch(employee, <record>, { ID: test }),
     "manager", Patch(manager, <record>, { ID: test }),
     ...
    )

    Hope this helps!

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @riadeasleh 

    No, you cannot do this in PowerApps.  That is very "programming-like" and PowerApps is a no-code non-development platform.

    You need to always specify the datasource name.  This goes for column names as well.

     

    I hope this is helpful for you.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard