PowerApps

Developing apps with Power Apps helps the business users solve business problems with easy-to-use tools that don’t require code / less code. In this article I am going to explain how to use a single form control associated with a SharePoint list to add/edit/view items using PowerApps.

I would assume you have the following setup

  • SharePoint list
  • Power App List Form connected with your SharePoint list

Following are the steps I am going to use to convert my form to support add/edit/view functionalities

Step – 1

The Param function retrieves a parameter passed to the app when it was launched. If the named parameter wasn’t passed, Param returns blank. The user will be redirected to the respective form based on ID and Mode parameters.

Step – 2

Assign the CurrentItem variable we have calculated in Step 1 here

Step – 3

Add a Label control and change its visibility expression as shown below:

Step – 4

Add a button outside the form control to create a record in SharePoint and change its visibility expression as shown below:

Change the button’s OnSelect property as shown below:

Step – 5

Add a button outside the form control to update an existing record in SharePoint based on ID parameter and change its visibility expression as shown below:

Change the button’s OnSelect property as shown below:

Demo of overall functionalities

I hope you find this article helpful. Contact me if you have any questions.

Requirement

I have a CustomConnector that connects to Microsoft Graph REST API to get the groups in an organization. This endpoint URL and query parameters such as orderby, filter, skiptoken, top are currently hardcoded but I would like to make it generic so that I can reuse by passing arguments to the connector from the PowerApps.

Solution

To create a custom connector, you must describe the API you want to connect to so that the connector understands the API’s operations and data structures. The custom connector wizard gives you a lot of options for defining how your connector functions, and how it is exposed in apps.

On the Definition page, The Request area displays information based on the HTTP request for the action. Choose Import from sample and configure sample as shown below:

At the top right of the wizard, choose Update connector. Now that we have configured the connector, test it to make sure it’s working properly.

On the Test page, create connection and return to the Test page:

Now, enter the values for the text fields, then choose Test operation.

The connector calls the API, and you can review the response.

Return to your PowerApps app and configure your expression as show below:

That is all. The Group Collection should have the REST API response data.

Important Note: Some requests return multiple pages of data so do not pass the $skiptoken for the first call. The $skiptoken parameter contains an opaque token that references the next page of results and is returned in the URL provided in the @odata.nextLink property in the response.