Power Apps Switch Function vs. the If function

  Рет қаралды 39,437

Shane Young

Shane Young

Күн бұрын

In this QTT (Quick Thursday Tip), we cover the PowerApps Switch function. Nothing crazy, just adding another core function to your skillset to make you better and possible more efficient at building apps.

Пікірлер: 82
@EugeneNaumenko_Music
@EugeneNaumenko_Music 3 жыл бұрын
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 3 жыл бұрын
Great to hear!
@NKBobcat
@NKBobcat 3 жыл бұрын
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 3 жыл бұрын
Nice Bob!
@jonathanwatkins1345
@jonathanwatkins1345 3 жыл бұрын
Wall suggestion... Chewy mural! (I know a guy) Thanks for the great videos, Shane. Always informative!
@ShanesCows
@ShanesCows 3 жыл бұрын
I like it. I actually have thoughts of creating an "employee of the month" picture of Chewy 😂
@jonathanwatkins1345
@jonathanwatkins1345 3 жыл бұрын
@@ShanesCows Let me know. I'm only couple hours away from Cincy and I have murals for years. thanks! Jon
@ezjensen
@ezjensen 3 жыл бұрын
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 3 жыл бұрын
Awesome. 😎
@EchoDaPogi
@EchoDaPogi 3 жыл бұрын
More Oakdale video please. Had issues on Sort / Filter / StartsWith with text box in gallery in Project Oakdale.
@ShanesCows
@ShanesCows 3 жыл бұрын
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
@cvkealey
@cvkealey 3 жыл бұрын
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 3 жыл бұрын
That's a great idea! Have fun :)
@SheIsObiquitous
@SheIsObiquitous 3 жыл бұрын
Short and sweet. Thanks
@ShanesCows
@ShanesCows 3 жыл бұрын
Glad you liked it!
@Mx81
@Mx81 3 жыл бұрын
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 3 жыл бұрын
Great suggestion!
@altino91255268
@altino91255268 3 жыл бұрын
Hi Shane, thanks for another video! I've seen all the videos before that!
@franknielsen3219
@franknielsen3219 3 жыл бұрын
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 3 жыл бұрын
I like it Frank!
@wendymason3263
@wendymason3263 3 жыл бұрын
Thanks Shane, great video!
@ShanesCows
@ShanesCows 3 жыл бұрын
My pleasure!
@pumakaua
@pumakaua 3 жыл бұрын
Awesome video as always Shane! Cheers from BurningPeru!
@ShanesCows
@ShanesCows 3 жыл бұрын
Hey, thanks!
@clare5967
@clare5967 3 жыл бұрын
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 3 жыл бұрын
Thanks for the idea! Added to my ever growing list.
@marrodgo
@marrodgo 3 жыл бұрын
Thank you very much for your videos!.... From Costa Rica, pura vida!
@ShanesCows
@ShanesCows 3 жыл бұрын
My pleasure!
@mauriciopardorojas7872
@mauriciopardorojas7872 2 жыл бұрын
Hi Shane, thanks, excellent explanation, from Colombia
@rachelshalem
@rachelshalem 3 жыл бұрын
Thank you Shane !! 😊
@ShanesCows
@ShanesCows 3 жыл бұрын
You are welcome 🙏
@Mrkk1103
@Mrkk1103 3 жыл бұрын
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 3 жыл бұрын
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 3 жыл бұрын
@@ShanesCows Thank you :-) I'll go and have a look!
@Mrkk1103
@Mrkk1103 3 жыл бұрын
ps Sorry for troubling you. I should have spotted that!
@IZeoClass
@IZeoClass 3 жыл бұрын
LMAO. I freaking love your thumbnails Shane!
@ShanesCows
@ShanesCows 3 жыл бұрын
Thanks. It is the silly little things that help I think. 😀
@NKBobcat
@NKBobcat 3 жыл бұрын
For me it's like If(need is simple, Use If, Switch)
@ShanesCows
@ShanesCows 3 жыл бұрын
😂
@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
@ash-world
@ash-world 3 жыл бұрын
Great video Shane. so that means for an Array Switch is not same as If !
@ShanesCows
@ShanesCows 3 жыл бұрын
🤔
@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.
@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.
@mtamitolanga
@mtamitolanga 3 жыл бұрын
Hi Shane .. switch is the simplified version of if 😁 thank you
@ShanesCows
@ShanesCows 3 жыл бұрын
No problem 👍
@iamdeepshekhar
@iamdeepshekhar 5 ай бұрын
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 5 ай бұрын
No, asking ChatGPT or Copilot for help is the best I got to offer.
@iamdeepshekhar
@iamdeepshekhar 5 ай бұрын
@@ShanesCows thank you 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
@mikepasin372
@mikepasin372 6 ай бұрын
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.
@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!
@TheToni2123
@TheToni2123 3 жыл бұрын
thx again
@ShanesCows
@ShanesCows 3 жыл бұрын
You're welcome!
@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")
@leetyler3102
@leetyler3102 3 жыл бұрын
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 3 жыл бұрын
Nope. It has been on the wish list for a long time.
@yourstruly9777
@yourstruly9777 3 жыл бұрын
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 3 жыл бұрын
I usually do approvals in Power Apps, not Flow. :) kzbin.info/www/bejne/amqyY2tqmcqCd6s
@kamranpatel4489
@kamranpatel4489 2 жыл бұрын
Hii Shane, How this can be implemented with combobox Selected items if conditions to be applied for specific valves
@gerfer6261
@gerfer6261 3 жыл бұрын
Good timing for SWITCH red 2 blue, but @the movement it is “If”-thanks
@ShanesCows
@ShanesCows 3 жыл бұрын
Happy to help
@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
@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
@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.
@simmyjer
@simmyjer Жыл бұрын
Do nested switch statements work?
@ShanesCows
@ShanesCows Жыл бұрын
I had to go try but Yes, you can. Weird but it works.
@simmyjer
@simmyjer Жыл бұрын
@@ShanesCows thanks Shane :)
@zanrleonardo
@zanrleonardo 3 жыл бұрын
Make a model drive vídeos Shane
@ShanesCows
@ShanesCows 3 жыл бұрын
Not on my immediate plans, we just don't have any customer demand for them. 😑
@lucas86999
@lucas86999 3 жыл бұрын
👍
@ShanesCows
@ShanesCows 3 жыл бұрын
🙏
@chap666ish
@chap666ish 3 жыл бұрын
In the popular vote Switch trumps If. Sounds political but it's not.
@ShanesCows
@ShanesCows 3 жыл бұрын
😂
Saving Power Apps Data with the Patch Function
17:59
Shane Young
Рет қаралды 59 М.
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 20 МЛН
Man Mocks Wife's Exercise Routine, Faces Embarrassment at Work #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 6 МЛН
PowerApps Calendar Control - Build your own using Galleries
35:02
PowerApps - Switch Statement (if else if else if else)
4:14
WeTechCareOfYou
Рет қаралды 6 М.
PowerApps filter gallery by dropdown
28:06
Shane Young
Рет қаралды 274 М.
Switch function in Power Apps - your best friend.   #37
14:52
Zbigniew Lukowski - Tutorials
Рет қаралды 1,9 М.
Patch vs Update vs UpdateIf in PowerApps (which one to use)
15:33
Alireza Aliabadi
Рет қаралды 27 М.
Named Formulas & User Defined Functions in Power Apps
13:41
Reza Dorrani
Рет қаралды 37 М.
Flattening a Data source in Power Apps (Data Manipulation)
20:34
PowerApps Forms - Form Mode
21:23
Shane Young
Рет қаралды 246 М.
Pivot Table in PowerApps
21:25
The Power Tutorials
Рет қаралды 10 М.
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 20 МЛН