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 / Using a Global Variabl...
Power Apps
Unanswered

Using a Global Variable with a Patch Function

(0) ShareShare
ReportReport
Posted on by 13

I'm looking to use a Variable as the base record with a patch function. Is this possible

 

Scenario example:

Global Variable - VarApproverLevel

 

VarApproverLevel = "Level1"

 

Patch code

Patch(Projects,

        LookUp(
                      Projects, ID = VarGoToItem), { VarApproverLevel: "Test"}))
I cant get this to work. What am i doing wrong?
 
Thanks in advance
Categories:
  • Micky Profile Picture
    365 Moderator on at

    Can you please share a screenshot of your code, and highlight the error?

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @Bolas 

     

    because we do not really know much about your existing code this might only be a direction for u to modify:

     

    If(
     VarApproverLevel = "Level1",
     Patch(Projects, LookUp(Projects, ID = VarGoToItem), { Level1: "Test"}),
     VarApproverLevel = "Level2",
     Patch(Projects, LookUp(Projects, ID = VarGoToItem), { Level2: "Test"}),
     // You can add more conditions here for other levels
     Patch(Projects, LookUp(Projects, ID = VarGoToItem), { /* Default case or error handling */ })
    )
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

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 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard