Power Apps Switch Function vs. the If function

  Рет қаралды 40,695

Shane Young

Shane Young

Күн бұрын

Пікірлер: 82
@NKBobcat
@NKBobcat 4 жыл бұрын
You saved me today. I have to hides some buttons based upon user department. Each button is named the same, looks the same but does very different thing. I was manipulating the Visible parameter with variables and if statements. Switch was meant for this use! I am so happy!
@ShanesCows
@ShanesCows 4 жыл бұрын
Nice Bob!
@EugeneNaumenko_Music
@EugeneNaumenko_Music 4 жыл бұрын
Shane, i just want to say thank you for your tuttors. When i was starting with PowerApps i was watching your videos a lot. Now i really know more and it's because of you! Thanks!
@ShanesCows
@ShanesCows 4 жыл бұрын
Great to hear!
@EchoDaPogi
@EchoDaPogi 4 жыл бұрын
More Oakdale video please. Had issues on Sort / Filter / StartsWith with text box in gallery in Project Oakdale.
@ShanesCows
@ShanesCows 4 жыл бұрын
Always more Oakdale! I agree. Did you check out the new class also? training.powerapps911.com/courses/create-apps-workflows-and-chatbots-for-microsoft-teams Could be fun. 😎 Also, I would love to hear more about the issues you ran into if you are willing to share. shane @powerapps91.com
@jonathanwatkins1345
@jonathanwatkins1345 4 жыл бұрын
Wall suggestion... Chewy mural! (I know a guy) Thanks for the great videos, Shane. Always informative!
@ShanesCows
@ShanesCows 4 жыл бұрын
I like it. I actually have thoughts of creating an "employee of the month" picture of Chewy 😂
@jonathanwatkins1345
@jonathanwatkins1345 4 жыл бұрын
@@ShanesCows Let me know. I'm only couple hours away from Cincy and I have murals for years. thanks! Jon
@cvkealey
@cvkealey 4 жыл бұрын
I use switch a LOT for navigation purposes, but have never thought of using it in the OnSelect of a button/icon. That should help me simplify and finally finish several apps I've been putting off finishing for some time because I was dreading those complicated If statements.
@ShanesCows
@ShanesCows 4 жыл бұрын
That's a great idea! Have fun :)
@ezjensen
@ezjensen 4 жыл бұрын
Great video Shane! I can see many apps that I've made I could go back and change If's to a switch.
@ShanesCows
@ShanesCows 4 жыл бұрын
Awesome. 😎
@KristofferFortuna
@KristofferFortuna Жыл бұрын
Hi Shane, awesome video. Can you do an IfError function example?
@ShanesCows
@ShanesCows Жыл бұрын
IfError + Patch a blank value with Formula-level error management kzbin.info/www/bejne/jIbOaJ6onM6nsNk
@altino91255268
@altino91255268 3 жыл бұрын
Hi Shane, thanks for another video! I've seen all the videos before that!
@pumakaua
@pumakaua 4 жыл бұрын
Awesome video as always Shane! Cheers from BurningPeru!
@ShanesCows
@ShanesCows 4 жыл бұрын
Hey, thanks!
@Mx81
@Mx81 4 жыл бұрын
Hi Shane, I would love a short video about „IfError“. I just discovered how powerful this function is and maybe it will help some other users too.
@ShanesCows
@ShanesCows 4 жыл бұрын
Great suggestion!
@wendymason3263
@wendymason3263 3 жыл бұрын
Thanks Shane, great video!
@ShanesCows
@ShanesCows 3 жыл бұрын
My pleasure!
@franknielsen3219
@franknielsen3219 4 жыл бұрын
Wauw. I keep messing up my IF´s and Switch looks to me like an ideal way to go. THX a lot. Did not know the function was there, only thought it was something in Flow. Regarding to your new room, get Chewy and Nicola in the background :D
@ShanesCows
@ShanesCows 4 жыл бұрын
I like it Frank!
@mauriciopardorojas7872
@mauriciopardorojas7872 2 жыл бұрын
Hi Shane, thanks, excellent explanation, from Colombia
@shubhangitayade816
@shubhangitayade816 Жыл бұрын
Hi thank you for great video. I am preparing for PL-900 exam can you please suggest where can I get practice questions?
@ShanesCows
@ShanesCows Жыл бұрын
I don’t sorry.
@SheIsObiquitous
@SheIsObiquitous 4 жыл бұрын
Short and sweet. Thanks
@ShanesCows
@ShanesCows 4 жыл бұрын
Glad you liked it!
@rachelshalem
@rachelshalem 3 жыл бұрын
Thank you Shane !! 😊
@ShanesCows
@ShanesCows 3 жыл бұрын
You are welcome 🙏
@marrodgo
@marrodgo 4 жыл бұрын
Thank you very much for your videos!.... From Costa Rica, pura vida!
@ShanesCows
@ShanesCows 4 жыл бұрын
My pleasure!
@Mrkk1103
@Mrkk1103 4 жыл бұрын
Thanks for this. I didn't know about Switch and I think my brain works that way so I'll be trying it. This week I've been trying to use Export/Import and I can't get Import to work so learning about that would be good as would looking at SaveData and LoadData. Great videos, thank you!
@ShanesCows
@ShanesCows 4 жыл бұрын
SaveData and LoadData covered here. :) kzbin.info/www/bejne/hKjFopd3bs9re80 Just remember, everytime you change the collection saveData and you can't go wrong. :)
@Mrkk1103
@Mrkk1103 4 жыл бұрын
@@ShanesCows Thank you :-) I'll go and have a look!
@Mrkk1103
@Mrkk1103 4 жыл бұрын
ps Sorry for troubling you. I should have spotted that!
@ash-world
@ash-world 4 жыл бұрын
Great video Shane. so that means for an Array Switch is not same as If !
@ShanesCows
@ShanesCows 4 жыл бұрын
🤔
@yourstruly9777
@yourstruly9777 4 жыл бұрын
Is there a way we can use a third response option in the approval flow requesting the creator to make corrections and resubmit the request which triggers the flow from where it left the first time , this came as a real time scenario where the requestor doesn’t want to go through the whole approval process again and instead pick from where it left
@ShanesCows
@ShanesCows 4 жыл бұрын
I usually do approvals in Power Apps, not Flow. :) kzbin.info/www/bejne/amqyY2tqmcqCd6s
@iamdeepshekhar
@iamdeepshekhar 8 ай бұрын
Hi Shane, Thank you so much for content. I've a query though : is there any online formatter or app, which can help me in formatting the complex power apps queries similar to Visual studio for C# code? (as the Out of the box, doesn't help much)
@ShanesCows
@ShanesCows 8 ай бұрын
No, asking ChatGPT or Copilot for help is the best I got to offer.
@iamdeepshekhar
@iamdeepshekhar 8 ай бұрын
@@ShanesCows thank you Shane 😊
@kamranpatel4489
@kamranpatel4489 2 жыл бұрын
Hii Shane, How this can be implemented with combobox Selected items if conditions to be applied for specific valves
@IZeoClass
@IZeoClass 4 жыл бұрын
LMAO. I freaking love your thumbnails Shane!
@ShanesCows
@ShanesCows 4 жыл бұрын
Thanks. It is the silly little things that help I think. 😀
@clare5967
@clare5967 4 жыл бұрын
Another great video,Thanks Shane! Switch is much easier to use with multi-conditions. BTW , looking forward you can make a video about GroupBy function, Pleeeeeese!
@ShanesCows
@ShanesCows 4 жыл бұрын
Thanks for the idea! Added to my ever growing list.
@mikepasin372
@mikepasin372 8 ай бұрын
Hi Shane, can I use switch to conditionally validate a dropdown list based on the select of a value in another dropdown? For example, if dropdown1 selected text is 'A', dropdown2 will have [1, 2, 3, 4], but if dropdown1 selected text is 'B', dropdown2 will have [5, 6, 7, 8], etc. Cheers.
@acm-yo4mp
@acm-yo4mp Жыл бұрын
Hi Shane, can use if condition like "If(DropDown.DisplayMode.Edit = DisplayMode.Edit,...)?
@ShanesCows
@ShanesCows Жыл бұрын
Not Exactly. It would be If(DropDown.DisplayMode = DisplayMode.Edit, "Yes", "No")
@NKBobcat
@NKBobcat 4 жыл бұрын
For me it's like If(need is simple, Use If, Switch)
@ShanesCows
@ShanesCows 4 жыл бұрын
😂
@leetyler3102
@leetyler3102 4 жыл бұрын
not sure if it's even possible but it's something thats driving me mad: can you lock the position of controls so they cannot move? example: a form you want to hide a control under criteria but you don't want to move the other controls because the form is laid out in a specific way.
@ShanesCows
@ShanesCows 4 жыл бұрын
Nope. It has been on the wish list for a long time.
@Danielx64
@Danielx64 3 жыл бұрын
Hi Shame, Great video. Just a question, while this is for PowerApps, I see that Power Automate also have the same thing. Would you happen to know how much of a performance difference it would be going from using 'if' to 'switch' in Power Automate? Thank you :)
@ShanesCows
@ShanesCows 3 жыл бұрын
I don't know. I bet it depends on the amount of evaluations and such.
@davidmckenzie1889
@davidmckenzie1889 2 жыл бұрын
In other languages (I'm recalling VBA, but that might be my memory playing tricks) SWITCH will evaluate the first bit, e.g. Dropdown1.Selected.Value once, whereas IF will evaluate it for every [attempted] match. Would make more of a difference if what you are comparing is complex (say, a concatenation of several dropdown selections), however even if this takes 1ms to evaluate and there are 500 options, IF would only take a maximum of 1/2 a second more to match with the last option and less if you match with one of the first 499 options since it will stop evaluating when if finds a match. Caveat: I don't know if this is how it would work but it seems reasonable. Maybe MS have coded this to be 'cleverer' so it is more efficient.
@simmyjer
@simmyjer 2 жыл бұрын
Do nested switch statements work?
@ShanesCows
@ShanesCows 2 жыл бұрын
I had to go try but Yes, you can. Weird but it works.
@simmyjer
@simmyjer 2 жыл бұрын
@@ShanesCows thanks Shane :)
@thewanderingcouple8378
@thewanderingcouple8378 Жыл бұрын
Hi my form's status coloumn has three options 1. New, 2, work in progress 3. Completed. When user will choose any field from request category the status field default value will be 1.New. If user put email Id in a diffrent field (column type person or group)then Status will be default 2.work in progress Finally when user will select ID created option Yes then status column default value should be completed. How to make this please help me.. whatever I learnt I learnt by you. Please show me an example how to write the formula for this scenario
@metehanb1997
@metehanb1997 2 жыл бұрын
Hello all, thank you for the great video! I still have one question: I have built a search app and would like to display the thumbnails depending on the document type. So, if it's a Word document, I want the thumbnail to be a Word icon. If it's an Excel file, an Excel icon and if it's a folder, a folder icon etc. I've tried this with nested If conditions and the function Right(ThisItem.'File name with extension', 4) = "docx" 'Word File') but unfortunately without success.... I am getting desperate. I wanted to build the function as follows: If(ThisItem.IsFolder, 'Folder File', Right(ThisItem.'File name with extension', 4) = "docx" 'Word File' etc.... By my logic, I would have thought this would work. How do I make it work? With which function is it possible? Thank you! :) Mete
@gerfer6261
@gerfer6261 4 жыл бұрын
Good timing for SWITCH red 2 blue, but @the movement it is “If”-thanks
@ShanesCows
@ShanesCows 4 жыл бұрын
Happy to help
@kamozzi1
@kamozzi1 3 жыл бұрын
Thanks for the video Shane, Quick question, how would we go about using switch/if when we have multiple controls in action. i.e. if i have 20 toggles and if any of them is set to No, display a text input otherwise hide. please advise?
@davidmckenzie1889
@davidmckenzie1889 2 жыл бұрын
Kamran, The easiest way to do this would be to use AND() - or the 'shorthand' version && - to return a TRUE or FALSE on the text input visible property. Something like: AND(Toggle1.Value, Toggle2.Value, Toggle3.Value, Toggle4.Value, Toggle5.Value) will return TRUE only if all 5 toggles are TRUE/Yes. For your particular example you would wrap this in a NOT() to have FALSE when all toggles are TRUE, i.e. text input not visible when all toggles are TRUE.
@raouleliasmiraglia148
@raouleliasmiraglia148 3 жыл бұрын
Hi Shane, first of all thank you for all these great videos! I have a question regarding the Switch function... I want to tell Powerapps, that If the number of Label1 is in the range between 0 and 1 then this very number should be displayed in red. If the number of Label 1 is in the range between 1 and 2, then it should be displayed green....etc... And somehow I can only tell Powerapps that If the number matches 1 then it should display in red. (so no range...) Is there a possibility, that I might have overseen? Greetings from Switzerland
@ShanesCows
@ShanesCows 3 жыл бұрын
I wouldn't use Switch, I would use If. If(value < 1, red, value >= 1 And value
@raouleliasmiraglia148
@raouleliasmiraglia148 3 жыл бұрын
@@ShanesCows Thank you very much!
@lk43wz
@lk43wz 3 жыл бұрын
Hi Shane, thanks for this useful video. However, I'm still trying to figure out how to use if/switch to identify a field in my gallery which hardware are too old (older than 3 years) and need to be replaced otherwise they're good for keep using. This is from a text property of the body in the HardwareGallery If(Value(ThisItem.AgeColumn)>3),Red,Green; Any advise is appreciated. Thank you Kel
@mtamitolanga
@mtamitolanga 4 жыл бұрын
Hi Shane .. switch is the simplified version of if 😁 thank you
@ShanesCows
@ShanesCows 4 жыл бұрын
No problem 👍
@zanrleonardo
@zanrleonardo 4 жыл бұрын
Make a model drive vídeos Shane
@ShanesCows
@ShanesCows 4 жыл бұрын
Not on my immediate plans, we just don't have any customer demand for them. 😑
@TheToni2123
@TheToni2123 4 жыл бұрын
thx again
@ShanesCows
@ShanesCows 4 жыл бұрын
You're welcome!
@lucas86999
@lucas86999 4 жыл бұрын
👍
@ShanesCows
@ShanesCows 4 жыл бұрын
🙏
@chap666ish
@chap666ish 4 жыл бұрын
In the popular vote Switch trumps If. Sounds political but it's not.
@ShanesCows
@ShanesCows 4 жыл бұрын
😂
Saving Power Apps Data with the Patch Function
17:59
Shane Young
Рет қаралды 65 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Patch vs Update vs UpdateIf in PowerApps (which one to use)
15:33
Alireza Aliabadi
Рет қаралды 28 М.
PowerApps AddColumns ShowColumns
25:13
Shane Young
Рет қаралды 64 М.
Power Apps Variables - All 5 Types
30:11
Shane Young
Рет қаралды 13 М.
PowerApps Patch Function
26:45
Shane Young
Рет қаралды 213 М.
Power Apps Modern Card Control Using Fluent 2 Design | Fluent 2 Component
21:54
Validate Inputs, Warn Users, and Disable Buttons in Power Apps
19:58
PATCH() across multiple tables & maintain referential integrity
14:35
Switch function in Power Apps - your best friend.   #37
14:52
Zbigniew Lukowski - Tutorials
Рет қаралды 2,1 М.
PowerApps - Switch Statement (if else if else if else)
4:14
WeTechCareOfYou
Рет қаралды 7 М.
Power Apps Components Tutorial
11:08
Power Apps Land
Рет қаралды 320
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН