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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,408)