cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CaiChicken
Advocate I
Advocate I

How to reset a GUID() ?

Hello Friend,

 

I'm using GUID() inside my app but I haven't find a method to generate a new GUID,

 

I tried write GUID() inside a TextInput Default and reset() the TextInput with no luck, any ideas?

 

Best,

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @CaiChicken :

Firstly,let me explain why you encounted this problem.

The point is GUID is a volatile function when used without an argument.For example, a label control for which the Text property is set to GUID() won't change while your app is active. Only closing and reopening the app will result in a different value.

Secondly,please try this solution:

The point is to store the value of GUID in a variable.

1\set the apps's OnStart property to:

 

Set(varvar,GUID()); /*varvar is my custom variable*/

 

2\add a textinput control(TextInput4😞

Default:

 

varvar

 

3\Add a button:

OnSelect:

 

Set(varvar,GUID());Reset(TextInput4)

 

2.gif

Best Regards,

Bof

 

 

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @CaiChicken :

Firstly,let me explain why you encounted this problem.

The point is GUID is a volatile function when used without an argument.For example, a label control for which the Text property is set to GUID() won't change while your app is active. Only closing and reopening the app will result in a different value.

Secondly,please try this solution:

The point is to store the value of GUID in a variable.

1\set the apps's OnStart property to:

 

Set(varvar,GUID()); /*varvar is my custom variable*/

 

2\add a textinput control(TextInput4😞

Default:

 

varvar

 

3\Add a button:

OnSelect:

 

Set(varvar,GUID());Reset(TextInput4)

 

2.gif

Best Regards,

Bof

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,296)