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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / The global Variable se...
Power Apps
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!
I have the same question (0)
  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at
    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
  • YH-18102220-0 Profile Picture
    6 on at
    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
    153,040 Most Valuable Professional on at
    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.
  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at
    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard