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 / Reset global variable
Power Apps
Answered

Reset global variable

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello i have a global variable that stores some data ( json data) How can i clear that variable when i push a button ? Like make the variable empty

Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 
    Like this

    Set(gblVariableJSON, Blank())

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hm not sure if its working. I  have an app where i send images from power apps to a web server using power automate. If i close app and open then send images. it works good. If i dont close the app but sends images, then it sends the same images and the power automate times out. Dont seems like when i hit the send button that it resends the collection it haves. I do have a reset on each image etc. I am using a pick image action 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    this its what happens when i hit send in power apps 

    ClearCollect(colBase64;DropColumns(AddColumns(imageCollection;"Base64";Mid(JSON(Image;JSONFormat.IncludeBinaryData);25;Len(JSON(Image;JSONFormat.IncludeBinaryData))-25));"Image"));;
    Set(JsonCol;JSON(colBase64;JSONFormat.IncludeBinaryData));; IDM.Run(reg;SONR;FORSIKRING;Jobbtype;JsonCol);; Reset(Jobbtype);; Reset(BarcodeScanner1);; Reset(AddREGBTN);; Reset(AddDmgIndi_btn);; Reset(CLOSEUP_DMG_BTN);; Reset(ADAS_BTN);; Reset(GLASSID_BTN);; (ADAS_IMG.Image);; Clear(imageCollection);; Clear(colBase64);; Set(JsonCol; Blank());; Reset(DMG_SCHEME_BTN);; Navigate(Home)

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 
    No idea.  I only know that's how you clear a global variable.

     

    The new question you are asking seems to be similar to your other post called "Clear, Cache, Collection".  I did not respond to that one because I do not know the answer.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • PowerAGuy Profile Picture
    270 on at

    @mdevaney 

     

    Thanks, your response helped me with a question I was just about to post!

  • ipapoutsidis Profile Picture
    50 on at

    It work just fine for me, Thanks @Anonymous 

  • NiteWalker Profile Picture
    71 on at

    Where is the best place to put this call? I have tried in in different OnVisibles, in the App part, in the SharePointIntegrations and it doesn't seem to work. The Set(varID, Blank()) part is what i am having troubles with.

  • PowerAGuy Profile Picture
    270 on at

    @NiteWalker 

    One place (and probably where most would use it) would be on the OnSelect property of a button

  • NiteWalker Profile Picture
    71 on at

    Thanks for the info.

     

    I figured out my issue... or rather what not to do. I was trying to use a variable to load the items for the datatable. This was not working very well, so I just put in the Lookup function directly in the items and it is working great now.

     

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard