Query String In PowerApps URL

Introduction

 
In this article, we will learn how to use query string parameters in the PowerApps URL and redirect to the specific item directly using the link from an email.
 
First, you need to create one custom SharePoint list to use in PowerApps to bind this list data into gallery controls. For this article, I’ve created the list called “Asset Tracker” and created the below columns.
 

Create PowerApps

 
You need to first login to PowerApps using your tenant account and create one blank canvas app using a tablet layout and provide your app name.
 
First, you need to create a data source connection. Click on the data source icon and search for the SharePoint and create a data source.
 
Insert the vertical gallery control and select the SharePoint data source (Asset Tracker) and select the layout Image, title, and subtitle. You can see that product image, employee id and name will be displayed on gallery control.
 
 
In the next step, please add another screen and rename it with “AssetDetails”. Insert the Display form and select the Asset Tracker data source.
 
 
Now, we need to pass the data of selected items from gallery control to this asset details page where we are going to display more information related to those records. Click on the arrow icon, set the OnSelect property as below. We’ve set the variable “record” and passed the selected item to this variable.
 
 
On the asset details screen, select the display form and set the Items property to “varRecord”. Now, we can see the data like employee id, name, asset image, make, model, and other details in the asset details page. Add button control on the asset details page to send the email to that item link on email with query string parameters.
 
 
In the next step, we need to add one more Office365Outlook data source for sending emails. Select the button control and set the OnSelect property as below.
 
 
To get the PowerApps link above, go to the Apps section in PowerApps, click on the 3 dots and click on the Details menu item. It will redirect to the App details page. We can use the Web link as PowerApps URL.
 
 
We’ve added “EmpID” parameter and set the current item id in PowerApps URL.
  1. <a href ='https://apps.powerapps.com/play/2917908e-28a7-42b8-aa4d-bebe712c552d?tenantId=2e55dbd7-d35f-47f7-879b-1d41f6fc6ee1?EmpID="& varRecord.ID &"'> click here </a>   
We’ve set the query string parameter in PowerApps URL as above. Now, we can use this query string parameter to redirect to the specific item page.
 
Click on the App and set the OnStart property as below.
 
 
We’re using the  Param("EmpID") function to get the query string parameter value, convert it to the numeric using the Value function and set it to the variable varEmpID. Now, we need to check if varEmpID is not equal to 0 then get the specific item and set it to the same variable “varRecord” and redirect to the Asset Details page.
 
Let’s click on the button  and  it will send out the below email.
 
 
When you click on the “click here” link from the email, It will redirect to the specific item page in PowerApps.
 
 
This way, we can use the query string parameter in PowerApps URL and redirect to the specific item on PowerApps. Happy Learning!!


Similar Articles