Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

The global Variable set is not working

(1) ShareShare
ReportReport
Posted on by 6
Hi All,

I think i have encountered a bug issue.

I am building an app and use global variable function set(varXXX, XXXX).
The issues I had,
1. I am trying to set up a global variable for last submit form ID and obtain it on the OnSuccess property  -> set(varLastID, form1.lastsubmit.ID) 
But after I finished it, the power app doesnt treat it as global variable. Other screen page cannot use varLastID.
 
2. Since varlastID doesnt work, so i change the syntax to -> set(varLastsubmitID, form1.lastsubmit). Now the varLastsubmitID is useable in the other screenpage. but I test it in the label text, it doesnt have nested data inside. 
For example, label1.text = varLastsubmit.ID is not working. the system doesnt recognize .ID
 
I am very confused why it doesnt work. Could someone kindly check what is going on? (FYI, the form1 I have submitted many times with all data)
 
Thanks!
  • WarrenBelz Profile Picture
    148,638 Most Valuable Professional on at
    The global Variable set is not working
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • WarrenBelz Profile Picture
    148,638 Most Valuable Professional on at
    The global Variable set is not working
    I use it on almost every Form I have, so I know it works (as it should). Can you please post the exact code you are using and where you are using it.
  • YH-18102220-0 Profile Picture
    6 on at
    The global Variable set is not working
    Hi @WarrenBelz ,
     
    I just tried your solution. it doesn't work. the variable does not have any value inside.
     
    I do not know what is going to on for the power app.
  • WarrenBelz Profile Picture
    148,638 Most Valuable Professional on at
    The global Variable set is not working
    The first one should work, however I actually use the same process as the second example on all of my Forms OnSuccess
    Set(
       gblRecord,
       Self.LastSubmit
    )
    then the Item of any form relating to that record is
    LookUp(
       SPList,
       ID = gblRecord.ID
    )
    as well as this any field you need to reference in the current record is simply
    gblRecord.TheFieldName
    From what you posted, your example on this one should be
    varLastsubmitID.ID
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1