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 GUID at APP Close
Power Apps
Unanswered

Reset GUID at APP Close

(0) ShareShare
ReportReport
Posted on by 9

I am creating a 3 screen app.

I have set ONSTART changed to ClearCollect( NewGUID, ForAll( [ 1 ], GUID() ) )

   from  set( NewGUID, GUID() ) )

In the first screen OnVisible property, a collection:

                     ClearCollect(collect1, {username : User().FullName, sessionid : NewGUID, creationdate : Now()} )

Here I have a Login button. OnSelect property is 

                     Patch('[dbo].[GRV_Details]',collect1)

 

The patch is giving me error : "Invalid Argument Type (table).

 

The collection of GUID is causing an issue. It is working fine with global variable. The database is updated at Login button.

Secondly, the GUID must get resetted at database update. How to achieve that? I thought in clearcollect will work and I will be able to clear the entry in collection to reset GUID value.

 

Regards,

Naresh R

 

Categories:
I have the same question (0)
  • Paul_C Profile Picture
    Microsoft Employee on at

    Hi Naresh,

     

    collect1 actually is a table (although it only has one entry), which is probably why you're getting the error. To get the first entry from the collection, you can do: First(collect1)

     

    Also note that the collection collect1 is only local to your app and distinct from the data source -- it will not affect the data source implicitly. So clearing the collection will have no effect on the data source, for instance. To change the data source you will need to do so explicitly using functions like Patch() or other functions that allow you to manipulate data sources.

     

    Here are some docs for some of these data source functions, if you want to read more:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-remove-removeif

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-update-updateif

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 617

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard