cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
langsem
Post Patron
Post Patron

Reset global variable

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

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@langsem 
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." 

View solution in original post

5 REPLIES 5
mdevaney
Super User
Super User

@langsem 
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." 

View solution in original post

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 

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)

@langsem 
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."

@mdevaney 

 

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

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,973)