Sign-up now and get instant access
Leave a comment
Customized training to master new skills and grow your business.
Beginner to advanced classes taught by Microsoft MVPs and Authors.
In-depth boot camps take you from a novice to mastery in less than a week.
Season Learning Pass
Get access to our very best training offerings for successful up-skilling.
Stream Pro Plus
Combine On-Demand Learning platform with face-to-face Virtual Mentoring.
Quick references for when you need a little guidance.
Summaries developed in conjunction with our Learn with the Nerds sessions.
Digital goodies - code samples, student files, and other must have files.
Stay up-to-date on all things Power BI, Power Apps, Microsoft 365 and Azure.
Earn money by driving sales through the Pragmatic Works' Training Affiliate Program.
It's time to address your client's training needs.
Learn how to get into IT with free training and mentorship.
Discover the faces behind our success: Meet our dedicated team
How can we help? Connect with Our Team Today!
Find all the information you’re looking for. We’re happy to help.
In this article, Nate Halliwell is going to delve into some powerful yet often overlooked PowerFX formulas that can drastically improve your Canvas app development. Whether you're a seasoned app maker or just starting out, these formulas are must-haves in your toolkit. We'll explore four underutilized formulas: IFERROR, SUBSTITUTE, COALESCE, and SWITCH.
As app makers, we want to ensure a smooth and error-free experience for our users. One common issue arises when displaying users' images, which sometimes leads to errors when searching for a person. To overcome this, we can utilize the IFERROR formula. By encapsulating the code that retrieves the user's image with IFERROR, we can gracefully handle the error and display a placeholder image instead. Users will no longer be presented with confusing error messages, improving their overall experience.
Text fields in tables often contain unnecessary or repetitive information that clutters the user interface. The SUBSTITUTE formula comes to the rescue! Let's say we have a department field that includes the word "trainer" before the actual department name. To remove this redundant information, we can use SUBSTITUTE. By substituting the "trainer-" prefix with a blank value, we effectively remove it from the displayed text. This simple formula helps clean up our app interface and presents cleaner data to users.
We've all been there – writing repetitive IF statements to handle blank values. The COALESCE formula offers an elegant solution to this problem. Instead of constructing multiple IF statements, COALESCE allows us to specify a list of values and returns the first non-blank value. Let's say we want to display the department of each user, but some users don't have a department listed. With COALESCE, we can provide a default value ("Unknown" in this case) when a blank value is encountered. This streamlines our code and improves maintainability.
Nested IF statements can quickly become unwieldy and hard to read. Enter the SWITCH statement, which offers a more concise and readable alternative. Instead of chaining multiple IF statements to compare a single value against different criteria, we can use SWITCH to provide all the match values and their corresponding results in a structured manner. For example, we can define different colors based on the department of an employee using SWITCH. This approach allows for easier maintenance and enhances code readability.
You have uncovered some powerful yet often underestimated PowerFX formulas. By incorporating IFERROR, SUBSTITUTE, COALESCE, and SWITCH into your Canvas app development workflow, you can significantly enhance the user experience, streamline your code, and unlock the full potential of your applications. Remember to experiment with these formulas and adapt them to your specific use cases to maximize their benefits.
Stay tuned to the Pragmatic Works' YouTube channel for more tips and tricks to elevate your app development skills. And if you're interested in learning more about Microsoft applications including Power BI, Power Automate, Excel, etc., then sign up for the Pragmatic Works' on-demand learning platform.
ABOUT THE AUTHOR
Nate Halliwell is a Power Platform enthusiast, specializing in Power Apps and Power Automate. He began his journey into the Power Platform as a “Citizen Developer” while working as a recruiter in talent acquisition. He used Pragmatic Works to train himself on the technology and hopes to use this new role as a trainer to help others achieve similar career transitions! Nate is PL-900 and PL-100 Certified, and ready to help you take on any Power Apps or Power Automate challenges you or your organization are currently facing! Outside of work, Nate is a husband, a father to 2 boys, and a beer league hockey player.
Join other Azure, Power Platform and SQL Server pros by subscribing to our blog.