Citizen Can, Episode 0: The Expand ~OR~ Save API calls by using expand with Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
gee you know an awful lot of tricks you're not a professional magician are you no i'm not a magician good afternoon good afternoon how are we doing so tell me about your challenge not the problem never problems they always chat the challenge um okay i want to send an email from flow that sends a daily update and i'm going to send something about a contact but also related accounts so my specific one was i had a subscription and that belongs to a specific member and they belong to a club and these are all related records so when i spit out the email instead of getting the contact's name or the club name i get a good um so i managed to work it out where i used to get records and but i know that's not the proper way to do it let's see um how we can do it so we start an instant flow right it's so from uh just a manual we can do it on a record if we want to but let's say for simplicity list all the records and we say context yeah right and i'd like to rename that and say context and then what you have done is basically for each contact let's simplify it let's say you want to get an account name and let's say a phone number uh from the account and maybe a website address from the account right so so what you have done something like get me a record get me a record please get me a record oh that's interesting yeah i'll remember that and here what you would say is it would be a parent company name value right so parent account parent account yeah yeah parent account and then let's do a simple when i i don't want to send the email so what i will do i will do a composer it's kind of building the body of the email right just so we can sound something yeah yeah yeah so i'll say contact we'll put full name full name and we put account name yeah account name and remember we also wanted the website from the account from the account yeah and not from the contact from the account so that's what we want so i think we just going ahead and run it just to to make sure it all works flow checker now that's interesting flowchecker starts issuing a warning because we didn't filter our contacts we say give us everything right and for now we just ignore i know look this is not super duper busy this is all context this is just sample yeah and i'll perform save and go probably should have renamed it but fair enough buttons contacts apply to each parent account compose that's a good name for it i think it's a great name they did a good job so we started and we going ahead and take five six and it's gonna take few seconds and one of the things we can talk in the future oh i failed anyway well one of the things is how to run things in parallel make it a little bit faster but uh that's not there but next failed i bet is it blank uh blank yeah we didn't filter fine whatever we we're not fast right so we could have added condition let's see um what non-failed records uh tell us okay so we've got patrick alpine ski house auburn ski house all great number one first record yvonne fourth coffee fourth coffee.com great um the challenge begins i add another one you have to step up from the parent account to another relationship get rekt get rekt and sort of it's getting cumbersome there's a lot of get records today's trick of trade is to use expand you probably heard of it before right yeah something along those lines yeah i heard of it and went i don't know what that is yeah okay so um let's go ahead and let's go for advanced options today we're not gonna talk about anything else but expand so expand basically allows me to specify hey look i need information from a related record great okay right so the one thing we need to do is to get the relationship right so here i use the great xram toolbox i could have specified just the attribute to expand i could have said hey look parent account the problem here is that it could be account could be contact it's the customer so there are two relationships in one yeah here we need to know the exact name of the relationship we're going down to right so i open go for the entity go for the menu to one relationships and here's the two relationships contact customer accounts custom contact customer contacts so depending on which one it is it's one or another right so i'll drill into relationship and that's this one parenthesis do i sense some irony in your voice i'm sure you have a better you know what i'll give you you told me that you've got better way and i went ahead i installed your favorite extension my favorite extension the magic rocket also known as the market okay you wanna take control or i trust you see okay or you uh you you won't walk me through i'll teach you you need to learn it's okay so we'll open the contact open the contact any contact uh yvonne was yes yvonne and then we're going to fire up the magic rocket so we're going to see this is the field right company name fourth coffee that's what you want this is the problem right when i go browse could be accounts could be contacts currently accounts could be context that's the problem right it comes out as a good it's disgusting yeah that's the magic rocket so we're going to click on the magic rocket and all fields all fails kaboom here we go let's have a look and find fourth coffee here we go i see you now facebook so there's three fields right behind it but if you use that one that's exactly the one you need to use actually that gives me an idea you can actually use that and build it dynamically but we're not gonna do that so we'll just go ahead and we'll put it here we're saying expand query i'm just gonna head you know and expand everything i'm saying give me everything from the account so what it gives me ability to do is to get here you can delete this one i don't need it right so one thing i really like to do first is to give it a test run and to see what's coming back i need to dive into into the details right so i really want to see what's coming back actually i already can see what's coming back yowozza right okay yeah nice but i've got jason view we ask for insane amount of data he's all the dots about the contact blah blah blah blah blah blah blah and he is the parent customer account id so you see all the data it keeps coming back so we've got number of employees where's the website where's the website and that's just from the list records action yeah i just added i say expand that so it gave me everything under on the account so it will have the name um it will have uh you know number of employees it's got everything so i'm not filtering it for now um but uh where's the website sir in the middle website url five up from the bottom here you go so website url and so we'll get value we go to flow go with it what we can do now so the account will be an item okay which is a single element then within that item we're gonna get parent account id website url slash website url okay that's one oh that's the wrong one let me swap let me say this is the website and this account this one is going to be again an item this is the current item the value so that's our current value and it's a name yeah and just go ahead and test it we'll do a drum roll that was quick yikes i'm not say compose here we go oh that is cool that's it look uh thank you for showing yeah the level up it's certainly gone a long way since last time i used it and definitely it looks like it's a bit simpler to find stuff then oh god yeah then metadata browser thank you for teaching me this i think i've just saved myself approximately a thousand api calls i completely forgot about this i as a developer should be aware of that and take into consideration when i do stuff when i write stuff but often it escapes me and yes it does save you uh api calls so if you loop and say through a thousand contacts you just saved yourself 2 000 api calls because you can actually drill further into relationships but that's for the next time that's for next time i'm excited don't forget [Music] let's come back
Info
Channel: 365.Training
Views: 862
Rating: undefined out of 5
Keywords: Power Automate, Power Platform, Citizen Developer, NoCode, LowCode, ProCodeNoCodeUnite, Flow
Id: vK0oymNG9Jc
Channel Id: undefined
Length: 11min 25sec (685 seconds)
Published: Sat Dec 19 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.