The ability to pre-populate controls is a win-win situation for both the makers and the users. The maker could potentially use a single app with similar fields for multiple reasons and the user has fewer fields to fill. This blog will walk you through how to build such an app using the Param function in a PowerApps Canvas app.
This blog walks you through how you can pre-populate the following controls:
- Text input
- Combo box
- Date picker
- Radio &
Consider a form used by employees who are being relocated. Depending on the user’s department, division, and locations, the URL is modified to have these fields pre-populated and then the link is sent to the end-user.
In this demo the app is built-in Portrait design, however, you can build the same using Landscape. In addition, this video primarily focuses on how to use PARAM and the URL, hence no steps are provided in saving the data. For saving you can use the Patch Function.
In order to improve the performance, we are doing two things, first assign a PARAM function to the SET function and second, add all the SET functions to the App’s OnStart. Below is a screenshot of what it looks like.
We then add the variables created by the SET function to each of the controls we are testing. For the Text input, Drop down, Radio and Toggle controls we can assign the variables in their defaults. The Combo Box and the Date picker are the only two controls we were do not use the variables but instead use Label as an intermediate step. The reason why this is done is best described in the video.
The following video walks you through a step-by-step process on how to build the app.
- Param function: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-param
- URI Parameters: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/embed-apps-dev#set-uri-parameters-for-your-app
- Building PowerApps from Scratch? Use Patch?: https://powerusers.microsoft.com/t5/News-Announcements-Formerly/Building-PowerApps-from-scratch-Use-Patch/ba-p/66276
- Hidden Gems Series #1: https://www.youtube.com/watch?v=e3PyNwBGV90
- Hidden Gems Series #2: https://www.youtube.com/watch?v=nlhYHoRyVwg
Make sure you check out my previous blog post and video on how to “Build your own Audit app”.
Want to learn more about the essentials of a Modern Site Architecture, Creating Engaging Content or Intranet Home Page Design? Great!