Working with Unique ID(s) In Power Apps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video i'm going to write my wrongs and i'm going to show you how to work with unique ids in power apps [Music] my name is colin kelly cook i'm an office 365 and power platform developer this is my channel where i share with you all my knowledge on everything powerapps sharepoint and office 365. please subscribe set up an alert so you know when my latest video is out and if you have any questions drop them in the comments so i did a video uh many many months ago probably one of my first ever videos where i talked about how to generate a unique id in powerapps now maybe i named that video wrong apologies i hold my hand up but some pointed out that yes the um reference or the unique idea i was creating wasn't necessarily unique and what i was actually trying to do was just create a string of characters representing a document from some other set of information so i wanted to come back and give you this video to show you how i deal with unique ids and also other ways to look at unique ids which are going to be actually unique and one to an extent could be um the same but the likelihood is so slim and that you can perform some checks if you wanted to but it's a very efficient way to do it so the first way and the simplest way is if you're using sharepoint list as a data source or even if you're using dataverse they already have a unique id contained within them so for example here i have my dev string list now this has a primary unique key so if i add a string test string and save it it gives it an id now it never reuses the id so i've actually already used this twice and i've added two strings in it's given me an id of three that will never be reused and it will never be duplicated so if i add a new one string four the id will be full so generally when i need to work with something unique where i'm working with say a list of users in one table and i need to represent those and match them up against things in another table i will use that id as the relationship so i may be looking up in this table id3 and i know i'm getting that specific user that's generally the route i use if you're using dataverse dataverse has within it its own unique id in the form of a good so for every item that it creates it creates a column by the name of the table that will give you back a good so exactly the same just slightly different now if you're not using sharepoint lists and you're not using dataverse then there is another way to do this which is powerful and will likely fulfill what you need if we create a label here for example there is a function in powerapps called good now what this will do is it will actually generate a good now i don't know exactly the mass but if you look it up i'm pretty sure it's fairly impossible for that to ever generate the same good twice unless you do it hundreds and hundreds of million times within the same split second because of the way it works and because of the way it develops it builds that good it's pretty much never going to be the same so what you can do is in your onstart you can generate a guid unique id generate a good and then in here i can have my unique id so now if we run our own start here's my good if we run my onstart again you'll see every time that function runs it creates a brand new good so every time it loads i'm creating a new grid so you could use that with a button you could use that with anything if you really really wanted to because that function always creates a new guide you could create the guide run a flow or a function check if that guide exists so do a lookup on the table and if that good exists generate another good chances are it's never going to happen but that is one way um so just to recap if i'm working with sharepoint lists i use the built-in id column it's always there it goes up um one at a time concurrently and it never reuses previous um ids so if i delete test string there three is gone by adding a new string you'll see it always goes to five so it'll never go back to three again so we can know for sure that we're never going to have conflicts there in dataverse as i say there is a column that is named the same as the table that will generate a good and that will always confirm that that's unique because that's it's your unique primary identifier and that you can guarantee will be unique so hopefully that helps everybody and you can go away and build some amazing apps with that [Music] [Music] [Music] you
Info
Channel: Novalogix
Views: 8,971
Rating: undefined out of 5
Keywords: Power App, Flow, PowerApp, Power Plaftorm, Office365, Low Code, development, uniqueID, Microsoft
Id: uOlmyOaggds
Channel Id: undefined
Length: 5min 49sec (349 seconds)
Published: Sun Apr 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.