Live Power Automate Cloud Flow Build & Competition Draw for 10,000 Subs #Tutorial #PowerAutomate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay folks I think that is me live I am here in Aberdine first time going Live on YouTube and I'm here to celebrate hitting 10,000 subscribers so I see a few folk in the chat thanks so much for for joining me today the format of today really is going to be me building out a solution hopefully to pick some Prize winners so I I had 34 prizes to give away some from myself some from pack T and also from uh Keith Aon who's a fellow MVP and the the aim is to build a flow that will hopefully successfully pick folk from random from the 140 odd people that have applied to this company competition so you'll see I'm wearing um a t-shirt here a t-shirt that I actually had made up um three three years ago um I first attended a community event South Coast Summit in Southampton just under three years ago and that the heart for those that uh know me uh represents a couple of things obviously the Power Platform I love it um but also um four years ago I had a card arrest so this this heart signifies that that event and again for those that don't know me the the whole reason I got involved in the Power Platform and the community is because of that event I was very passionate about sport I enjoyed cycling loads and then subsequently after the arrest I had to really pull back on Sport and exercise and I've had many complications since but platform and the community has given me a focus so that's what my t-shirt is all about so I think we we'll get cracking uh like I said this the first time I've gone live before so hopefully everything works as intended um I've got some fancy little scenes I can switch so you should now hopefully see my my desktop as well as the ongoing chat and it's great to see some familiar faces in the chat there so thanks very much for coming and joining me today we can see the prizes on screen um I've got one of two 1H hour sessions with myself that's obviously the best prize then there's a Microsoft 365 business standard 12month license a few prints of um or one print sorry of learn Microsoft power apps one of two ebooks of that same book one of three books for the Microsoft Office 365 in SharePoint online cookbook and then one of 25 five LinkedIn premium trial licenses so let's see if we can get started and I will attempt to well like I say successfully build this as a test flow but then we'll we'll launch it and pick our winners so I have a SharePoint site to get me started and in there I have all of our applicants and uh actually if I change the view in to a gallery there we go we can see some of those names so if you've entered hopefully you will see your name in this lovely list um and uh interestingly there are a couple of duplicates as well so I'm going to build a flow that will remove those duplicates so hopefully you'll get to see a few different techniques whilst building this flow I've also got a list with the list of prizes um and again what I'm going to do at the end of the flow is to write the winner of each of these prizes into this list I have also a document library and in that document Library as well as all the competition winners so I can find your email addresses I'm not going to let you see that because I don't want to get into trouble for giving away your personal data um but I have a Word document and uh the word document has some test names and some test prizes so good practice as always let's build a test version of this flow first and then when I'm confident I'll change it to the data source of those entrance and also the official prizes now if I open up a new tab this is how I often prototype you don't see this when I do live videos because I obviously edit all this stuff out but if I click on new flow it will actually launch me a brand new flow with no trigger and the way I've done that as you can see is just based on the URL so the URL is for slf flow flows slne and what I'm actually going to do is switch to full screen so hopefully that will mean it's easier for folk to be able to see the screen so brand new flow and I'm going to base it on a manual trigger because that is the easiest way to do a prototype I'm going to hide co-pilot because there's no co-pilot involved in this build today and what I want to do here is I want to bring in the sample data that I have for both the sample prizes and the sample winners or entrance the test data that I just showed you um and we'll do some naming as well so make sure that we call this our our entrance and I will get my test name entrance here and we can pop that across into our compose and we'll actually turn this in into an array but uh it is uh hopefully going to allow us to to get test data then I'm going to add another compose and I will add in the potential prizes so we'll go here and put this in as prizes and I'm obviously going to swap this all out later on as I build out the flow and connect it up to that data source that uh I've showed you on SharePoint so jumping back onto here and if I put in my pretend prizes you'll like the flow Maestro Masterpiece the canvas Commando cup dashboard Dynamo trophy you'll never guess I use GPT to to put some of these things together so I'm going to jump onto my screen quickly and just show you in theory what I'm going to try and build in in Layman so I've got 34 prizes I've got 142 entrance unfortunately all 142 people cannot win a prize um and what I'm going to do is I'm going to put all your names into a hat I'm going to remove any duplicates and then for each of those prizes the one of 34 I'm going to Loop through them all I'm going to select a random person from that uh 142 um and I'll then remove that person from the array so I'm actually going to use an apply to each which is not something I use often I could do this very easily or with a select but I wanted to make this as random as possible and show some techniques and also using arrays and variables so we're going to remove an entrance from the hat so they can't receive more than one prize they'll be recorded as a winner against that prize and then at the final I'll output The Prize winners into a table or something like that just so I've got a record so that is the plan so I pop back open my flow I have my entrance I have my prizes and in order to randomize or to demonstrate what it would like to stick your hand into that hat and mix it all up and uh after each turn Again mix everyone up I'm going to actually turn the well comma separated values into an array that also includes a guid and the guid will be random and I'll use that random to then sort the list so that everyone will be in a in a nice randomized State and I will Loop through that but we'll we'll start building so so the select is going to take our entrance and I am going to use our expression tab here and I'm going to use the Expression split and that is going to allow us to split the entrance uh based on a comma and so that will get us a nice array and that will give us the name of the entrant um but also like I say I'm going to assign a guid as well so a guid is based on an Expression which is just guid open close brackets that gets a random number and the name because I'm splitting on that compose entrance which is a comma separated list is going to be based on the expression item and so what that should do is it should give us an array that contains the name and a random guid assigned to that uh that group of people and then I'm going to add in another compose and I'm just going to apply a sort so we'll put a sort as the name here i' actually probably should change this to select the uh entrance with guid just to keep things nice and tidy so I can remind myself what I'm doing and then uh what I'm going to do in this one is using an expression here I'm going to do a sort and that sort is going to be based on the output from our entrance with the guid and with the sort you have to specify the key so in single quotes I'm going to put in guid as the key that we're sorting on and before I do anything else let's save it and we'll test it and see what the output looks like so always very nervous doing a live demo hopefully the demo Gods behave and so what we have here is my comma separated list of entrance my comma separated list of prizes but what I've done is I've taken that comma separated list of entrance I've turned it into an array like we see here and then I've assigned each of those random entrance a guid and then by applying a sort you'll see that I've now got shobon at the top um and somewhere in there there will be everyone else but they'll all be in a random order my aim is to implement that through the apply to each um and then it'll be the equivalent of someone putting a hand in the Hat wriggling it about and pulling out the next person so that gives us the basics of selecting our entrance for the competition and then what I need to do is I need to create an apply to each and that apply to each is going to through each of our prizes um with the input here I'm going to use an expression again to split and of course I'll update this to use the SharePoint list later but the split is going to be based on our prizes and we're going to split again on a semicolon and so that will get me an array of all the prizes and then as I Loop through each of those prizes I want to pick someone from from our um entrance and of course our entrance is going to reduce in numbers as we uh progress through this flow so I actually want to initialize a variable because I want to remove the person that's being selected in each of those Loops from the variable so this is a good example of when you might need a variable when I actually need to update the data source and we're going to call this our entrance with guid and it's going to be an array and the the value for that array is going to be based on the select entrance with guid so the output from the select entrance with guid will be set to our initial initialized variable the sort is no longer going to happen outside of the apply to each but I'll I'll deal with that shortly uh what I want to do now is I want to select someone from this variable at random so I could do it um again with a compose I'm using a compose really to demonstrate the Expressions um and you'll notice a bug here as I insert that compose it's actually picked up the old compose name or the last compos name but I'm going to call this compose random uh random number and if you think about it I'm going to go into that variable I'm going to move everyone about in that in that variable and then I'm going to choose a random number from zero to this the length of that variable and that allows me then to pick someone from random from the the modeled up list that I have of of people um and so I'm going to use expression in here called Rand which gives me a random number from zero to something and I'm going to base it on the length of the expression so you'll see you'll see length here open close brackets I can go to Dynamic content I can choose the entrance with guid and that'll give me a random number from zero to the length of that variable which will reduce in size because I'm going to remove each selected random person from that list so if I hit add that'll pick me a number from zero to the length and then what I need to do is I need to get my winner so again I'm using a compose just to demonstrate this you could could potentially uh combine all these Expressions but we'll call this compose the uh winner and this compose winner is going to be based on the dynamic content from our entrance with guid and you may have seen an expression first which gets me the first value from uh an array well I'm going to use what's called an integer index so I can do this square brackets with a zero that would get me the first but because I've now composed a random number I can actually use that value there in the expression and so that allows me to get the winner and I'm just going to have to say thank you very much to uh flight bug there thank you very much for um the shout out and the fivr much appreciated so back onto the flow we've got a random number we're composing our winner using that variable um now that is going to get us an object and that object is going to be based on the structure that I have for our entrance with the guid which is the name and the guid and what I ideally want to do is I want to remove not only identify but also remove that user from the variable so I'm going to add in an action here we're going to use a filter array and that filter array is going going to take our original array that we have here and then I'm going to filter on the guid um not equal to the guid in this uh compose winner um and by doing that it means we remove that winner and they won't um obviously be included in the next Loop so uh here I'm going to go into the expression tab I'm going to type in item open clue brackets and square brackets and type in guid and that will get me the uh guid from this variable which is based on this uh variable here which is based on this structure so we'll be getting the guid we're filtering that array and then we're looking to see if the winers goodd is in this array so in order to create an expression for that we can go to the FX here into Dynamic content choose the compos winner and I want to get back the guid of the winner that I've chos chosing so we'll see at the moment the expression or the condition that's in the filter array is based on is equal to um and that would equal to true and that would then return just the one user so I actually want to change it to is not equal to and that will remove the winner from that array so that they can't be selected in the next loop it's also important to note that we shouldn't turn on concurrency because if we do we're going to have a a conflict with the update of arrays and potentially end up in a right mess next I'm going to add in another action and I'm going to set the variable so the original variable that I had for our um for our entrance with guid I'm going to set it to the body of the filter array and all that's going to do now is update this variable with the new body of the array from the filter array and of course that's based on the user that's being removed and it'll be updated and therefore they can't win the next Prize or at least that is the hope so I need to have a a wee break for a for a glass of water and just uh think think this one through CU I've done a bit of planning on this one but I have to admit I'm building uh from scratch here so right now what we have is we have the entrance the prizes we've added a guid onto the entrance we've initialized a variable that has all the entrance with our guid I'm going to think about this composed sort I've got a random number based on zero and the length of the variable I've composed the winner based on the variable and the number that's been generated that's an integer index I'm filtering that user out I'm updating our original variable so that they no longer exist and what I really should do just to make sure that I don't forget who has won and who hasn't won is to add in another compose which is naughtily been named composed sort um and I'll call that compose winner uh compose winner of prize is what we'll call it because we've already got a compose winner up there and I'm going to create an object so some squiggly brackets like so with can create a key which can be their name we can create a prize and put in a sem semicolon there as well so their name is going to be based on the output of this composed winner but we need to specifically get their name so again we'll go into Expressions Dynamic content I can go and choose the outputs of the composed winner but I want to get their name and we'll add that in there something that's quite common when people are building out objects don't forget your comma and then the prize is going to be based on this Loop so we have an apply to each Loop that's happening here and the prize is going to be based on the current item so right at the bottom we have appli to each current item and that will get us our prize now I'm building it like this because it will enable me to use a technique for bringing the object into an array outside the apply to each I could technically initialize a variable for this and I could append this object to an array but I'm going to use this technique just so I can demonstrate some things I've also realized that I need to put this in double quotes so you'll have seen that just here I've added in some double quotes around these strings and hopefully that will keep everything happy so that gets us our winner of prize and then outside of this I'm going to add in a compose and that'll enable me to hopefully compose an array of all of our winners and in order to do that I use this FX expression you can use outputs and as long as I name the compose action that's here that's inside the apply to each it'll actually create me an array and we need to put some underscores in there it's not K sensitive as far as I recall but we're coming very close to a point where I'm going to save it and test it and make sure everything works so I'll go ahead and save that so now we have a saved flow I need to get this sort in because I would like the the variables to or I'd like the guid to change and in fact I probably want to get this selected inside the apply to each to because I want to select new guids each time the apply to each runs so if I think about this one I probably need to pull this sort in if it will let me pull all this select in we've now got based on that split we've got the entrance with a guid we've got a sort which will sort those users based on the guid I need to also um update the variable so that um it's got the most recent users so we're selecting from our entrance we're sorting them I need to change this actually let's think I'm GNA pull this out and I'm going to save and test actually and see where I'm at because as you do with uh build and test check out the logic and then we can extend it so wait for the flow to test so James has asked a question why do the goids need to change each time my thought was to try and simulate someone mixing up the hat so if you've got all the names in the Hat if I apply guids and sort it outside the apply to each then those names will always be in the same order and whilst I do pick a random number from zero to the length of the array inside the apply to each I wanted to simulate the mixing up and then the random selection and may well be it I'm making it too difficult for myself but we'll we'll test it and uh see what we uh see what comes with this see if I get any errors first of all so green ticks as you probably all know are always good and a flow ran which is definitely very good so I guess we didn't look at before the the variable which is not that complicated it's initializing a variable which is BAS select which has our random users but in here I'm selecting a random number so you can see it's looping five times I've got five potential prizes based on my test data if I go to the next one it's 12 next one it's six next one it's 13 next one it's 14 again but it doesn't matter because what we should see is um the winner so we've got Thomas here we've got on number two we've got you in we have got Jamal we've got Charlotte and we've got Isabella but what we should also see is in the filter array what will happen is the array will reduce in size so actually it's probably better to see this um going all the way to the end at number five and you'll actually see if you pay particular attention to this little scroll bar here if I start from the beginning uh this scroll bar here will actually start to grow because there are fewer people so you can see it change ever so slightly in size um and what that's doing is it's uh removing the winner from the variable so by the end of it we won't have the five winners that were selected and if I go into my composed winners and look at the raw output we have got 1 two 3 four five different unique winners based on that run so technically it does was what I was hoping for albeit I was going to mix up a bit with a guid within the loop so that it's even more random so um let's a we a we think about this one um here I'm applying the guid and it's based on the split but at this point I'm actually probably better um adding the guid inside here based on the variable containing the names so I'll give this I'll give this a go and if I can't work it out then I might have to backtrack and just go with route one which still randomizes but not as random as I'd hoped the pressure of doing stuff live so I've got my entrance I'm selecting those entrance um with a goodd I think what would be quite interesting now would be to introduce the real potential entrance um so we we'll switch up the data source here for our entrance entrance and I'm going to add add in an action here get items and we will get items from my YouTube live site that I've got so I'll go into my YouTube live live I will pick the the competition entrance and that will now bring all my entrance into this um flow if I go into my select entrance things are a bit different here because previously I built this based on a split based on this compose but now actually it's going to be based on the value from the get items so we can see there the body value of get items and the name is no longer based on item it's going to be based on one of the D damic pills as they're called in America um and if I go onto here we should be able to get the entrant name so the guid is still the same idea um I'll use the guid to generate a random number and I can actually get rid of the composed entrance and that way I won't confuse myself and let's just do a save and test and make sure this works and we get some of you guys appearing on the um selection for Prize winners albeit this is a test at this point so don't go celebrating I see that I'm getting an error message here about get items doesn't have a limiting folder parameter this is a warning rather than error and a little trick actually if I go into the what is it limit entries to folder I can actually put in a forward slash like so and if I save that it should actually suppress that error because I'm limiting it to the root I like the fact that Kristoff has uh given me permission to uh continue with the the structure of the flow as it is with the goodd outside the apply to each I think I'm going that way to be honest because my brain is not thinking far enough ahead on what should be done so we'll test it and this should hopefully uh select random people um from our uh live list albeit it's assigning them to five of the random pretend prizes I'm getting an error message so we'll just try that again hit test let's try it again I'll hit save first and then we'll try test again come on demo Gods right so it's saved let's go back and then I'll jump back into edit and then I'll try and test we've still got our get get items which is encouraging and I think if I hit test and manually hopefully require JS failed to load thank you very much power automate right we've got to get items I've got a forward slash there's no changes there the changes here are valid entr name is valid I might have to switch across to the classic if this keeps appearing I will save it one more time the demo go the demo Gods let's give it a test otherwise I'm switching right let's switch into classic and I've seen this as well I'm not not sweating yet so uh we will get this working so got items is there so it doesn't look like I've lost anything let's go and give this a test I wonder if this is to do with a connection reference it is so I think I've got a bug in the new designer about connection references I'd added the SharePoint it wasn't allowing the connection to establish but now we've got it up and running we've got our get items the thing to check really have we got our real entrance in here so I do recognize some of these names as real entrance which is fantastic we've got all 140 odd and if I go to the very bottom we have remember this is a test you haven't won at this point but these are real names I have duplicates in there so I need to remove those duplicates and I know that because when I went and had a look at the competition entrance and did an a to zed we will see there's a few folk there that have had a couple of of uh duplicate entries and I'll let you off but I'm going to uh remove you as a duplicate so what we'll do is back into our flow back into edit um what we need to do is do a comparison with a union a union is not going to work with the guid so I'm actually going to have to knock that guid out and add it in in the next bit so I'll knock it out here and I will just add in using the text control the name entrant name that gives us an array of names and then I can use a union with a compose to remove those sneaky duplicates so we'll just rename that to remove duplicates I'll do a union based on the select with guid you add in that array twice and so what you'll see is there um Union with the body of Select in uh body of Select entrance with guid that's in twice you can pair itself against itself that will remove the duplicates I'll add in a compose to do a a check on the number of entrance because we've got 140 odd we should probably have less so we'll check check the number with that we can use length and we can go into Dynamic content and choose the output of remove duplicates that'll let us see how many we've now got I need to add in that guid I'd really love to add in that GID inside so I am going to at the moment this removes the duplicates it just gives me the names if I initially ize that variable as an array here and then inside here the winner is based on the variable so I think what I'm going to do in here is to set the variable to random random sort so what I'm going to do in here is I'm going to insert another select as you'll see this is getting quite complicated um the select is going to be based on our compose of removed duplicates which is there that is going to give us the name and it will also allow us to generate a guid so I can insert that guid in there the name is going to be based on the item because that is an array of names and so I can put that in there I can then pull my composed sort down into the apply to each the sort can be based on this select above so I can just do a sort on our select above on the guid key and say okay this is then going to be based on our sorted array I hit save keyer fingers crosses no errors and let's test it again so we test this if it runs okay we can explore for the history didn't run okay the from property of the select is of type integer so let me just check the composed remove duplicates I think I've put the composed check number into the select rather than the remove duplicates so if we look at the remove duplicates and we look at the check number that is 99 wow there really have that many oh my get items my get items is probably not returning everyone into the list so um let's go and also uh up the uh page pation to um well I know there's only 140 but I'll make it uh 200 and uh let's just check this select compose random number it should be based on the compos remove duplicates so that's why I've got an error there so compose remove duplicates let's save it and test it again so I get items will take a bit longer I reckon we should probably have oh we got a green tick which is a bonus right and our check number we got 138 so we did start with um if I go and refresh this I think I can have a look actually if I go into list settings I think there were maybe [Music] 141 um if I go down here and add in a total and account for the entrance and say okay to that 141 entrance the flow is now down to 138 which is a bonus our variable is initialized as an empty array the apply to each is still going to choose a random number the random number should be further down because of course the array is empty at that point so I need to move that underneath this uh sort but the select should be taking all these names it should be assigning a guid which it is it should be sorting it so we've got Josel in in this run if I move on to the next we shouldn't have jel in at the top nope we got someone else at the top and if I go to next we should have someone else at the top so that shuffle is now happening which is good I just need to move this random number because on the first instance it won't work because the array is empty but on every subsequent one it will work because at that point the array has got someone in in it so I suspect the first winner in this composed winners is actually going to be um well probably the first person in the list actually because it was zero and zero obviously is an integer is the first object in an array so that would be slightly unfair so we'll go into edit we will move that random number to underneath the sort here that random number is based on the length of this variable which at this point get set to our randomly sorted people and I'm going to give it one last save and test and then I will look to bring in the prizes the real prizes so this will take will it take a little bit longer maybe not let's see at least we've got a green tick which is good so in into the apply to each if we have a look at the set variable I note that ad's asked um we may have all the names in every single run um what about removing the winner each time if the variable set to the original so what's happening in this Loop is we have a select that has all the individuals ah yeah and so the source for this at the moment is it based on the get items so actually I should be putting everyone I need to remind myself here now let's think about it get items is going to get everyone prizes is fine we'll swap out the select entrance with guid is no longer select entrance with GID it's just selecting the entrance so we've got an array of names we're removing the duplicates which drops us from the 141 down to the 138 we've got an initialized variable which is an m empty variable we've got a select which gets everyone from this uh um original select entrance but actually I probably should plop the select entrance with guid into the initialized variable and then this should be based on the variable because it will then as as has been pointed out um it'll be based on the actual variable content so I've kind of chosen this setup deliberately because I thought I'd be exploring a lot of um a lot of different techniques and also thinking as well and normally when I put together a video I do a lot of this thinking behind the scenes and so you don't get to benefit from seeing what my logic is and what my thinking is and how I test things and the problems I have and the errors I get um so hopefully it's a different style of of video um and you can see how has come together so at the moment this as has been pointed out is based on the remove duplicates which is obviously going to be the full copy of the array each time so everyone gets added back in which is not what I'm looking for so good shout out there um so this array here actually needs to be based on our compos remove duplicates so we can go here and choose the output from the composed remove duplicates and then I can put the input to this select as the entrance with guid variable and that means that throughout the loop as well as applying a random guid and sorting it will'll update um that with the sorted um array but we will also um update the variable again with that filter and I think for the purpose of testing again I'm going to actually add in another compose because it would be quite quite good to see the length of this variable reduce um from the original 138 down to 37 36 34 Etc so I'm going to for the purpose of testing insert a length on the length of this variable here and that will allow us to see that variable reduce in size and be confident that I'm not going to give everyone or I'm not going to give the same person um lots of prizes um despite there being a touch of Randomness with this uh flow and how it's built with random numbers and guids so our flow has run um I suppose the first thing I I want to check is have we got winners in theory we have um but I can see I've got uh a potential issue with the structure of the data so that's not a problem we can work through that so if we have a look at our select our select is going to take all of those names in that original array then it's going to turn it into an array with the names and the guids and then it's going to sort it it's going to set the random order which is fine and I believe it's going to go wrong in the second Loop because I'm now thinking ahead random numbers fine compos winner will be fine the filter array will be fine and if I go to the compose we've now got 137 in that array and if I go up to my original check number I had 138 so we definitely knock someone out of the array but in the second Loop if we look at the original structure that I've got here where the names are in this um value state with the the square brackets the next Loop is actually going to get a bit messy I think yep so because the structure has changed I've now got objects in my array and then I can see the input if I look at the output rather than assigning a guid to my um original structure I've now got an additional good because the structure of the source array has changed why did I think about doing it this way and making it difficult for myself right let's work it out so the easiest what the easiest way to do it I think I might want to use another expression here called set property and set property will allow me to then update the original guid because I'd still like to have this Randomness and I think it's it's good you get to see some thinking going on here so our initial initialized variable is based on this structure and that's really what's causing the issue because a structure that we have in the initialized variable does not match the subsequent structure that I'm looking for that contains a guid so what I really want to do is to convert this initialized variable um and the structure of it sorry into this same struct structure here with a name and a guid um so I will insert another select believe it or not so I'm going to add in a select here and add in a placeholder for a guid and it doesn't really matter I could just I could add in a guid or I could just leave the guid empty but ultimately I want to make it match the structure so I'll add in um based on our composed remove duplicates and we'll call this um uh guid structure structure um and in there I'm going to insert their name I'm going to insert their guid and the name is going to be based on the expression for item um the guid I can actually just leave empty rather than setting this variable based on the removing duplicates it's now going to be based on this select which is the remove duplicates with the name and the guid and so I can remove that and change the output here and then in the apply to each in the select this bit here is um now going to change let's hope this works so this is where we're going to use a completely different uh setup rather than specifying name and guid um I'm actually going to use a different expression um you may have seen or didn't see I just toggled from the the array mode text mode and there is an expression set property I really hope there is because it's not autoc completing but I'm pretty confident there is and what set property does it's got three properties it's got the object in this case that is our object that contains the name and the guid um it asks you to specify the name of the property that you want to update in this case it is the guid property and then what do you want to update with well I want to update it with another guid so I'll use that guid expression and I'll say okay it's either set property or update property so This Is The Moment of Truth we'll hit save and we'll test it again it ran which is always a bonus um if we have a look at that initialized variable you can see I've got the names of people and they guids if we go into the apply to each in that select we have gone from the array with no guid to an array with guids that allows us to sort it um and we can see we've got kada at the top here um if we go on to next we'll see that we've now got another random um order of people so we took the updated array that we had with that original sort order and we've now got a new sort order I go into the next one again we should have that one and we should have a change on the sort so we do so we've got Abdul and Rachel and then we've got Michael and faran at the top here so we're definitely sorting um the other thing I'd like to check is if I go right back to the start if we have a look at the this compose here so we've got 137 users in that filtered array we should hopefully in the next one have 136 which is good and then we should have 135 which is good and again we should see when it catches up 134 so definitely we're removing the um people that have already won from that array and then if we look at the composed winners and show the output we can see we've got five randomly selected winners uh or beit this is a test this is a test um and in theory we're ready to bring in the official prizes okay um so I'm just having a quick look at the chat I don't think this is I don't think there's anything that I can see that I need to act upon right now so I'm going to add in the final get items which will bring in all the prizes we can change the composed prizes and then we can do a test with the prizes and then I'll do the official draw with the prizes so get items and get items and we'll call this get items prizes we'll change the site address and we'll or choose a site address which is my YouTube live the list name which is the prizes and I will get an error in the float or a warning in the flow Checker there but if I limit folders with a forward slash like so like I did in the new design designer the warning disappears um instead of doing my compos prizes which is my CSV comma separated list um I want to Now update my apply to each because my apply to each is currently looping through those uh prizes um which a split on that comma separated list but now I want it to Loop through the get items prizes so I'll knock that split I will insert the value from the get items prizes in the composed winner of prize it's no longer based on the current item because the current item is based on the object which is all the data within that structure and previously the data within that structure was just a prize name whereas now it's all the columns within the data source so I'll take out that current item I will insert the um name of the prize if I can find it amongst all this stuff in here what did I call it so if I go to prizes I call it prize what is a prize so if I search for prize that will now output the prize into my um compose action the only final final bit that I want to do before I actually run it live is to update I want to be able to uh update the name of the user with the prize because remember I have a list of prizes with winners um in my whoops in my uh apply to each I am looping through all the prizes so actually if I was to insert an update item I could then update so actually what I'm going to do for the purpose of testing remember this is testing I will put in a text uh column called uh test winners okay so no please no se celebrating yet um this is going to be the test winners for the purpose of testing my flow um um and I'm going to insert um an update item as well and hopefully I don't hit API limits from uh doing all this testing so into the POS possibly ad I see your suggestion um we'll go we'll go with this um so January 202 not January 24 um YouTube live the list name is going to be the prizes the ID is going to be based on the ID from this Loop because I'm looping through the prizes here and so just like I picked out the prize of the winner I can also get the ID of the get items prizes which should match the ID of the item I want to update and I'm going to update the test winner remember this is not the this is not you winning right now so the name I can actually just copy this expression here so couple ways to do it I could go and peek at the code and grab name like so um into the test winners and we'll paste that in there say okay and save and this should hopefully do everything that I want but in test mode so 100% this is test mode you're not winning prizes here we are going to test it and if it all works I will switch it from test winners to real winners so if I go across onto this list right now we can see we're getting some names don't celebrate if you're watching this because this is test winners um not winners so we're still in test mode right now um it looks like the flow is working if we check the flow it has succeeded and if I go into that list again and sort to A to Z based on the test winners we will hopefully see that there are no duplicate names so again this is a test please do not celebrate this is a test um so I'll put this um well I'll delete this column will I I'll hide it because I if I delete it I might upset my power automate flow so ID's ready for this he is looking to win the big prize um let's see if I can sort this by sort it by ID again because then I can here we go back in the order of the prizes so let's remind ourselves yes I can see there's some drum rolls going on here this is brilliant um we have an hour session with me what could be better than that say a 1H hour remote session and I'll show you how to build something like this two of those 1our sessions we've got the business Standard 12 month license the books from Pac te and the eBooks from Pac T thank you very much Pac T and also we have the LinkedIn premium trials from Keith Atherton um I hope everyone's enjoyed watching this and I will stay on afterwards to to answer any questions in the chat until things die down but let's see if we can now go and choose our winners with this flow and do I temp fate and switch back to the new designer what am I thinking right it's still got V3 equals false let's go V3 equals true I need to go with it I need to switch into this new designer everything will work have faith okay there's been a request from from bottom to top of our flow so we have um get items which is getting all the competition entrance from a list we have the get item prizes again all the prizes from a list and we're limiting the entries to a folder that's a little um hack I want to say if you put a forward slash it suppresses the error message or the warning message sorry not the error message then I have a composed prizes which is is um redundant I could delete it I'm going to leave it because I don't want to Temp fate so that was from the earlier build I've then got all the entrance in a new shaped array so I've repurposed the data by using a select I've toggled this text mode here and we have the entrant names into a newly purposed array I'm using that to then remove the duplicates because I noticed I'm not going to tell people off but I noticed so people have accidentally applied more than once which is fine I didn't maybe have my terms and conditions set out properly in my competition but it's a good demonstration of using Union based on a reshaped or repurposed array here and removing those duplicates I've then got a compose for the purpose of debug which allows me to check the length of that removed duplicates array so that is based on the expression length and then the composed remove duplicates I'm then creating a new new structure to include a guid and setting the output of that to our variable which is our entrance with guid so the output from the select above goes into that initialized variable in the apply to each we're then looping through all the prizes if we remind ourselves the request or the requirement was to Loop through all 34 prizes for each of them select a random person from a hat of entrance I try to simulate the mixing up and then remove the entrance from from the hat and also um remove them from the array but also record that winner against a prize and output The Prize winners I said there were 142 I think there were maybe 141 this apply to each is looping through all those prizes we're using a select and a set property to add in or not to add in sorry but to update the object within the entrance array which includes a guid to a new random guid and that allows us to then sort based on that guid property which is simulating that mixing up of the users in the Hat I then set that to the output this variable is updated to the output of the sorted array I've got another compos in here for debug um with a random number orbe it I say debug um I could put that full expression in against the next one here um um which enables us to select the random user so we're using the number that's output from the random random uh we're using the random number that's based on zero and the length of the array to um select someone at random from that array filter array is making sure that we're removing the guid um that's equal to the guid of the winner so you'll see the expression there as a hover over is um composed winner guid I then update the variable to that filtered body and that enables us to make sure that we're removing those people from that array from the hat so they don't get the opportunity to win more than one prize I've got another compose for debug which enables me to check the length of that updated variable so we checked to make sure that we were actually removing that user and we we are and then create an object and that object includes the name of the winner and also the prize which is based on the apply to each data source which is our prize list and then I do an update on the item which is currently on test winners but I'm going to remove that and remove that property and we'll add in the actual winner property now and hope I can just not can't paste in paste in the expression there hit in add and that's it so the final bit is just using a clever little trick outputs and the name of the compos within the apply to each Loop which ultimately allows me to take this object and convert it into an array without the use of variables so I've demonstrated when we do need to use a variable we've needed it here to um manage the users with our guids because we're updating the data source but I've also showed you how to create an array from the output using this select and this um outputs expression this is it this is it so I'm going to say if this flow fails for whatever reason I will reset and start again um for for for fairness so what I'm going to do is I'm going to um I'm going to run it and see if it finishes if it finishes then we will um check to make sure the results um are in and the winners have been chosen so over onto my SharePoint list if I do one last refresh that SharePoint list has all the prizes no winners I'm going to go with the new designer we'll hit test go into the manual gulp the flow is running it took 20 seconds last time to complete there's definitely silence my microphone is still working but I'm just keeping my fingers crossed and it's run and can already see based on the output so we have some winners on screen already but if I go across onto my SharePoint list and if I do a refresh we have some winners so Christian Banu you are of course the the you've got the best prize an hour remote session with me so I will get in contact with all Prize winners and let you know how to click claim your prizes um but I want to say thanks to everyone that's come along tonight and watched um hopefully you've learned something and thank you very much for the support over the last three years I never expected to become uh or enjoy uh doing something like this it was very much out of my comfort zone so I bet everyone else is wondering what what have I won so let's have a look Christian and benu you've got the top prize as I mentioned we've got Satish has won the Microsoft 365 business standard license there is a copy of the learn power apps book that's Olen shial um Matas has won an ebook as Asama and then mate tooth um Michael Clark and Jason mcandrew also won the ebooks and then the winners of the premium trial licenses we've got sshh William Boon Steven Mark new Neils Joan Alex Fabio Stephanie kada raakesh watana elwin breu Adib Austin Simon Derek Elaine braywood who's my neighbor uh Nim Danielle Abdul and S oh I'm G get this one out Shar um I apologize I got that wrong I tried um it worked we managed it um thank you very much for coming along tonight um and I look forward to U producing my next video and uh helping folk out in the community right so um any questions and in fact I had it prepared are we whiskey to celebrate um thank you for helping me reach 10 10,000 subscribers um over a million people have watched my YouTube channel um the amount of comments likes Etc is is overwhelming number of minutes hours that I'm watched each each uh month now but uh cheers thank you very much so I'm more than happy to stay on for um another you know 10 20 minutes if people drop off that's fine but if anyone wants to ask any questions feel free to use the chat and I'll happily field some questions I did have some questions on the form submission so I can maybe pick up some of those questions and answer those um whilst we're waiting so I'll do that I'll jump across onto the the document with the questions let me just drag that off of [Music] screen but do feel free to also use the chat and ask questions thank you Kristoff I uh I hope I get to 20 as well that be it' be a great achievement for sure so I've got some some questions here but I'll keep an eye on the chat as well if I just change my scene here so you can see the sheet without the emails just the names um I'm not going to answer Seal's question about licensing that's a mean questions here no one likes uh licensing um here's a question what was the right way to gather requirements for a client how to get the right clients oh I don't know maybe I should tell you a bit about my role um I I work at Microsoft as a Cloud solution architect and so work with with customers clients and a whole mixture of work on the Power Platform um but dayto day you'll be surprised I don't do that much on power automate so my power automate is actually from my days on the Forum where I was a super user and and became an MVP so really um in terms of getting the right clients I'm lucky enough to have clients through the work that I do um so I can't can't really guide you on that one but keep working that's from from Rachel so Rachel is definitely in the community I recognize Rachel's name and doing amazing things so keep going that's all I can say um some power automate books um I've got a couple of power automate books um there is a chap called Paul stalk who's released a book um who's on the Forum and that's by O'Reilly and there is also a power automate book a workflow automation book by Aaron gamet from Pac te so I've got a couple of books there on power automate I was looking over to my side because I have all my books there cheers folks um how to start learning power automate for beginners Well I would say go and try answering questions on the Forum is my uh suggestion because the uh forum is a great place to get ideas and ultimately if you're looking for solutions to solve then um go and jump on the Forum and you'll get those free ideas you don't have to necessarily solve it for those people but solve it for yourself and then at least you've got an excuse to build something and try something out um my biggest challenge When developing power apps I can't think of a particular challenge but I do like a challenge ultimately so if there is a challenge out there uh let me know and I'll I'll have a look uploading documents I am not going to be able to answer all these questions I will not claim to be the knowledge of all I don't think there's anyone out there and I think it's uh better to be honest that if you don't know the answer you know you can go and either look it up you can ask chat gbt these days or um speak with your colleagues Friends Ask on forums ask in WhatsApp groups so I don't know all the answers I would say uh copilot studio is an interesting one no I really like co-pilot studio and have been playing with it this week at work um it's pretty amazing in terms of what the generative stuff can do so no longer do you need to admin all the topics and the trigger words you can use generative AI I really like that and AD mentioned that books are not the best in his opinion which yeah is true I mean I think the books that are out probably don't have much around the new designer which you saw me playing with today and struggling with with some of the the issues that are there um so books will never be as up to date as a documentation online but it's a structured approach so if you're wanting to get some ideas you like the structure you want to start from the beginning and go from zero to not quite hero but zero to a better understanding a book is definitely a structured way of of of learning even if maybe some of those screenshots are outdate like this one how to be on point oh thanks very much uh Ru um I don't know to be honest uh it's nice to get feedback like that and I really appreciate any any positive but equally any constructive feedback as well because ultimately I would like to get better at what I do and if you look back at some of my videos from right back at the beginning three years ago I did not have much confidence and certainly wouldn't have seen myself doing a live session like this so yeah you need to start somewhere um and keep practicing it's like anything if you want to become good at riding a bike you need to practice my favorite Power ultimate action you saw plenty of it today the select action I love repurposing an array um I see I've got a question in the chat there from Ali b365 and Ali B is actually deo's uh son so uh a guid Alister is a random set of numbers and they're quite often used to um as a sort of primary key or a primary you won't know what a primary key is but it's a random set of numbers so a guid unlike random which is from 0o to a length as in 0 to 10 you get a number between 0 and 10 a guid is a string of numbers and so it's even more randomized and it's used by systems I didn't ask my son to plant a question but uh it's good to see him getting involved uh why did I start to be a YouTube blogger I started because of my cardiac arrest um I was um struggling to keep myself um focused I guess when I first uh had my rest I lost my sport um and going out and helping people in The Forum I started doing wondered if I could solve problems and then surprise myself and kept going and here I am now so I didn't expect to um certainly didn't expect to get 10,000 subscribers didn't expect to get over a million views um and now I'm kind of overwhelmed with where things are at but I appreciate there still a lot to go still a lot to learn and I do learn every day and you know try to make things better each time um so I started as a distraction really to um to my health um and it's become a focus for me it's like having a sport uh oh Kristoff thank you very much Kristoff um ad has asked me the question will I be at the cyu summit um the Scottish Summit uh but that's yeah it's the same group of folk that organize it I will in fact be at the Scottish Summit because it is in Aberdine and I am from Aberdine so I'm very excited that it's coming to Aberdine I think it's a great opportunity for folk of Aberdine to get involved in the Power Platform so I hope that folk um realize it's coming it's middle of October and it's at the Tekk which is the uh exhibition Conference Center in Aberdine it's a fantastic venue um so I'm really looking forward to it and it's a great chance to not only learn from all those folk that are speaking and maybe I'll get a speaking slot so the speaking slots are open for March um and March only so if you want to speak make sure you get a um submission in for March and uh fingers crossed but I'll definitely be there a great chance to meet folk and I'll be delighted to meet as many people as possible that are are there um it'll be good fun definitely and the evening as well will be good um I'm sure and yes I can't wait I really can't wait it's amazing to think that you know as I mentioned at the beginning 3 years ago I I had this shirt created because I went to the South Coast Summit um and uh it's now coming to Aberdine it's it's absolutely amazing done full circle uh how can power automate be used to transform data well you need to check out my Advanced video on HTML tables um right about the 20 minute Mark you can see how to transform or um yeah transform the data so that your rows become columns um I've got an example of that on one of my videos um so thank you very much Jacob for that question um how do I balance work work life well yeah it's a tough one I've got a very supportive family um I definitely do lots of taxi driving at the weekend uh but but um they they definitely know that I enjoy my YouTube so they they support me with the with the YouTube and let me do my videos over the weekend otherwise I'll be grumpy although I'm not grumpy that often I don't think maybe my son will confirm or deny how do I find drive to create videos um really it's about first of all finding an idea and each week you know I'm working on the Power Platform and I'm thinking of new ideas and and last week I did a video on the new mistl language model um so I'm always looking for ideas I'm looking for inspiration from Forum so I quite often help out on WhatsApp on on LinkedIn on YouTube on the Forum on uh Reddit on Facebook I'm I'm everywhere looking and trying to help people out um so I take inspiration from the different questions and then look for video ideas off the back of that sometimes it's building a solution based on a question but sometimes it's building a solution based on new technology so mistol was the new technology and a couple weeks back it was Cloud versus desktop flows because I think that's quite often confused people think power automate is one thing but uh there are a couple of products potentially arguably a third and I decided to cover a video on that so I just every weekend try and come up with a new idea I like this can I work for you well um this is more play at the moment so um maybe eventually I'll be independent I was asked that question actually on a podcast with uh John and Mike um and they asked me that question would I ever go independent so not at the moment I don't think but maybe one day who knows um and then I'm pretty much getting to the end I realize I haven't answered all the questions um I would like to learn the basics of power automate well I'm going to finish on that question and say that based on that question wanting to learn the basics of power automate objects arrays I've definitely got videos on Json objects arrays and stuff like that on my YouTube um but jump on the Forum I would say and start picking up questions don't necessarily have to solve them um or solve them for the end user but solve them for yourself initially get yourself a developer tenant and start understanding how to write out expressions and and build and the same with power apps and co-pilot studio and all the other tools just start challenging yourself and the Forum is the best place to find these challenges my daughter and my son now are commenting well I'm going to uh call it a night I think and uh I will be in contact with all of those that have won prizes don't necessarily expect me to contact you tonight um but I will get in contact with you over the next few days and let you know how you can claim those prizes and uh it would be great to hear from you and uh thanks very much everyone for for entering but also thanks very much for watching and supporting me with my channel over the last three years oh and definitely James good shout I will be in Manchester um for the Manchester Power Platform user group so if anyone lives anywhere near Manchester um do make sure you check that out um I think it's the 27th of March but uh I'll be through in Manchester and it'll be great to see as many people as possible I'll also I should say I'll also be in Brussels in June so if anyone's in Brussels in June for the the European Power Platform conference I'll be demoing some Advanced Techniques so definitely come and say hello if you're in Brussels otherwise see you in Aberdine hopefully right folks thank you very much once again for coming along and uh I'll see you again sometime soon cheers
Info
Channel: DamoBird365
Views: 639
Rating: undefined out of 5
Keywords:
Id: pS6p210nVj0
Channel Id: undefined
Length: 83min 30sec (5010 seconds)
Published: Sun Mar 10 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.