• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Tachytelic.net

  • Get in Touch
  • About Me

PowerApps

How to access PowerApps Studio when developing a Teams App

August 28, 2021 by Paulie Leave a Comment

When developing an app in PowerApps for Teams, you are restricted to the editing the app within Teams. This is tolerable for a basic app, but quickly becomes frustrating if you are spending a lot of time developing an app.

I have learned to put up with this, but really wanted access to the normal interface. A recent update to PowerApps studio meant I had to change the Authoring version of a teams based app but I was unable to do that via the Teams interface. So this made me even more determined to find a way to access the normal Power Apps Studio.

It is actually quite simple to do and you just need to form the correct URL to access Power Apps Studio for a Teams based App. You need a couple of bits of information:

  • The Environment ID the Team containing the App.
  • The App ID.

Start by going into the Power Apps Tab within Teams, then click on build, and select the Team containing the app that you want to work on.

Image of Power Apps Build Tab in Microsoft Teams

Get the Environment ID

There are many ways to get the environment ID, but from here, simply click on the ellipses on the right hand pane and choose “Open in Power Apps”. This will launch a browser window with a URL such as:

https://make.powerapps.com/environments/7eb61244-9d3f-455f-8b52-112c17c3dac2/solutions

Take the environment ID from the URL and close the browser to go back to Teams.

Collect the App ID

To collect the ID of the Power App do the following:

  • In the default “Built by this team” tab, click on the See all link:
  • This will show you all of the objects associated with the team. Click on the ellipses next to the app that you want to edit and click Details:
  • Copy the App ID from the Details page:

Now that you have both the Environment ID and the App ID you can formulate the correct URL to edit the app directly in your browser:

https://make.powerapps.com/e/[Environment]/canvas/?action=edit&app-id=%2Fproviders%2FMicrosoft.PowerApps%2Fapps%2F[App ID]

Simply replace [Environment] and [App ID] with the appropriate values. You can also specify what version of the studio you would like to use by using a URL like this:

https://make.powerapps.com/e/[Environment]/canvas/?action=edit&app-id=%2Fproviders%2FMicrosoft.PowerApps%2Fapps%2F[App ID]&studio-version=v3.21082.34.197169591

To make things a bit easier for you, you can just put the Environment and the App ID into the boxes below and the URL will be generated for you.

Power App Studio URL:

In my opinion, this makes editing Teams based apps so much easier. I wonder if it was obvious to everyone else how to do this already and I just missed it! Hope this is helpful to you!

Filed Under: Power Platform Tagged With: PowerApps

Super Simple flow to get more than 5000 SharePoint Items

December 9, 2020 by Paulie 52 Comments

I’ve done a series of blog posts on how to get more than 5000 items from a SharePoint list using Power Automate. While helping someone else out I figured out a way to make it much easier.

If you’re not interested in knowing how it works, just download the flow and reconfigure it for your environment.

Overview

In this example the flow is triggered by PowerApps, but the same method could be used for any trigger. Let’s take a look at the complete flow and then I will explain each step in detail:

Super easy flow to get more than 5,000 items from a SharePoint list

Step by Step Explanation

Here is a explanation of every step of the flow in the order they appear in the screenshot above

  1. Trigger Action
    Is the flow trigger action. This could be PowerApps, the HTTP connector or anything that suits your situation.
  2. Compose Action ‘querySettings’
    This is a compose action which specifies the query settings for the flow.
    Image of a Compose Action which specifies the query settings for the SharePoint API Query
    It has two properties:
    • listName – Specifies the name of the SharePoint list that you want to retrieve items from.
    • fields – Is a comma separated list of fields that will be retrieved from the SharePoint list.
  3. Send an HTTP Request to SharePoint ‘getLowestID’
    This step gets the ID of the first record in the SharePoint List.
  4. Send an HTTP Request to SharePoint ‘getHighestID’
    Gets the ID of the last record in the SharePoint List.
  5. Compose Action ‘threads’
    This flow is going to execute multiple simultaneous queries to SharePoint. Each of which will return a maximum of 5,000 records. Specify the number of threads you will need to cover the number of records that you have in total.
    For example, if you have 9,000 records you will need 2 threads. If you have 23,000 you will need 5 threads. For example:
    [ 0, 1, 2, 3, 4 ]
  6. Compose Action ‘itemsPerThread’
    This action calculates the number of items to fetch in each thread. If you have 9,000 items it will get 4,500 items per thread. The expression is:
    add(div(sub(body('getHighestID')?['value'][0]['ID'],body('getLowestID')?['value'][0]['ID']), length(variables('threads'))),1 )
  7. Apply to each
    The apply to each action is where the SharePoint queries take place. It is important to configure the concurrency options on this step to ensure it is set to at least the number of threads you have configured:
    Image showing how to specify apply to each concurrency
    Within the apply to each the following actions take place:
    1. Compose action ‘lowID’
      Calculates the lowest ID to find in the current iteration:
      add(body('getLowestID')?['value'][0]['ID'], mul(outputs('itemsPerThread'), item()))
    2. Compose action ‘highID’
      Calculates the highest ID to find in the current iteration:
      add(body('getLowestID')?['value'][0]['ID'], mul(outputs('itemsPerThread'), add(item(), 1))
    3. Send an HTTP Request to SharePoint
      This is where the actual SharePoint query takes place. Using the inputs from the previous steps. The expression in the Uri field is:
      _api/Web/Lists/GetByTitle('@{outputs('querySettings')['listName']}')/[email protected]{outputs('querySettings')['fields']}&$filter=ID ge @{outputs('lowID')} and ID le @{outputs('highID')}&$top=5000
      Image of SharePoint HTTP Action being used to collect 5000 records from SharePoint
  8. Compose Action ‘Sample Output’
    This action isn’t required for the flow to run. It is used to output two records from the first iteration of the SharePoint API query. This can be used to generate the required JSON Schema in the final step.
    take(outputs('querySharepoint')[0]['body']['value'],2)
  9. Response Action
    This is used to send the data back to PowerApps. You need to modify the Response Body JSON Schema. If you run the flow once you can use the output of the “Sample Data” step and use the “Generate from Sample” function.

    The body content unions all of the data that is returned from SharePoint into a single array. This will need to be adjusted according to the number of threads that you have configured:
union(
outputs('querySharepoint')[0]['body']['value'],
outputs('querySharepoint')[1]['body']['value'],
outputs('querySharepoint')[2]['body']['value'],
outputs('querySharepoint')[3]['body']['value']
)

Conclusion

This is an incredibly easy way to get more than 5000 items from a SharePoint list. It is also very fast. I was able to get 17,000 rows in 5 seconds and someone I am working with was able to get 5,000 rows in two seconds!

Download the Flow

This flow is simple enough that you don’t really need to understand how it works, you can just import it into your environment and reconfigure to your needs.

Download the flow here and import it into your environment.

Filed Under: Power Platform Tagged With: Power Automate, PowerApps, SharePoint Online

How to screenshot an entire Flow in Power Automate with Google Chrome

October 25, 2020 by Paulie Leave a Comment

If you have a flow in Power Automate flow which is bigger than you can display on screen capturing the complete process can be quite time consuming. Multiple images need to be manually stitched together and it is not an easy process.

Power Automate Screenshot using Google Chrome

This method requires no add-ins, is free and easy to do. It requires a little bit of configuration of Chrome.

Configure Google Chrome

  1. Press CTRL-SHIFT-I to bring up the developer tools pane.
  2. Now press CTRL-SHIFT-M to bring up the device toolbar.
  3. From the Device drop down menu, select edit:
    Image of Google Chrome Device Editor Drop Down
  4. Click Add Custom Device and then use the following settings:
    Image of Chrome Developer tools creating a new emulated device for capturing full screen images of Power Automate Flows
  5. Press Save and close the Emulated Devices Panel.
  6. Close the Chrome developer tools (Press CTRL-SHIFT-I again)

Use Chrome to take full page Screenshots

Now the setup of Chrome is complete. To take the full screenshot of Power Automate using Chrome do the following:

  1. Navigate to the flow you want to capture.
  2. Go back into Developer Tools again (CTRL-SHIFT-I)
  3. Bring up the Device Toolbar again (CTRL-SHIFT-M)
  4. From the drop down device list select the new “Power Automate” device:
    Image of Chrome Device Menu Showing Custom Power Automate Device
    You will now see Chrome Automatically adjust the zoom level to accommodate the new device resolution and your flow may be barely visible!
    Image of Google Chrome showing an entire Power Automate Flow in one screen ready for a screenshot
  5. Now Press CTRL-SHIFT-P and the command window will pop-up.
  6. In the command window type screenshot and select Capture Full Size Screenshot:

Chrome will take a couple of seconds and then download the screenshot to your default downloads folder. You will find a huge image ready for you to crop it down to just the content that you need.

Other Tips for Capturing Images of Flows

When using the process above to share a flow, I also do the following to make it easier for the person receiving the image to comprehend:

  • Include as many comments in the flow as possible.
  • Expand every element of the flow before you take your screenshot so that it is all visible.
  • If you are using expressions, add them to the comments so that others can copy them:
    Image of a Power Automate Expression as a comment on a flow step
  • Use something like Camtasia Snagit to add call-outs to explain certain parts of the flow:
    Image of a screenshot of a Power Automate Flow with an additional callout added from Camtasia SnagIT

Sharing your Power Automate Flow images

If you have used the method above, then you might find that the viewer has a hard time viewing such a large image.

When I post on the Power Automate Community Forums I upload my large flow image, but also upload it to imgbb.com because that has a viewer which makes it easy to view large images.

If you are publishing the images on your own WordPress blog, then the Magic Zoom Plus add-in provides a really good way for visitors to be able to view the entire flow easily. Here is an example of a large flow being displayed with Magic Zoom plus:

Image of an entire Power Automate Flow that uses Parallel Branches to get records from a SharePoint list

Filed Under: Power Platform Tagged With: Power Automate, PowerApps

Address Lookup in PowerApps with Power Automate and loqate

May 14, 2020 by Paulie 11 Comments

This post covers using Loqate API to auto-fill address details in PowerApps. Manual entry of key customer and supplier details is error prone and time consuming.

The Loqate API is really simple, so you can develop a solution in a couple of minutes.

Watch the video for a demonstration of how I was able to develop a Power App that enables address search:

Address Lookup in PowerApps with Loqate

The app in the video uses two flows to get address information from Loqate.

The first flow uses the Interactive Find API method to get a list of possible address matches. Each result contains a unique ID which is used to drive the second flow.

The second flow uses the Retrieve API to get the details of the selected address from the first result set.

First Flow: Interactive Find

Image showing details of a Flow in Power Automate used to Interact with the Loqate API

The flow is quite self explanatory. There are two inputs

  • The country code.
  • The search query.

These variables are inserted into the the query string and submitted to loqate using a HTTP action.

The interactive find returns a JSON array, which looks like this:

[
  {
    "Id": "GB|RM|A|53530442",
    "Type": "Address",
    "Text": "Microsoft, 2 Kingdom Street",
    "Highlight": "0-9;0-6",
    "Description": "London, W2 6BD"
  },
  {
    "Id": "GB|RM|A|55068353",
    "Type": "Address",
    "Text": "Microsoft Reactor, 70 Wilson Street",
    "Highlight": ";0-6",
    "Description": "London, EC2A 2DB"
  }
]

The Id column, which is highlighted above provides the input for the next flow.

The addresses are loaded into a collection which is used as the data source for the gallery of addresses:

Image showing the creation of a collection in PowerApps that stores address data from loqate
ClearCollect(Addresses, TestAddressLookup.Run(txtAddressLookup.Text, dropCountry.Selected.Value))

Second Flow: loqate reteive

The second flow uses the Unique ID retrieved in the first flow to get all the details of the selected address:

Like the first flow, the results are stored in a collection, with the following code:

ClearCollect(AddressDetails, loqateRetrieve.Run(ThisItem.Id));
UpdateContext({searchVisible: false})
Image showing the execution of a flow in PowerApps which collects address details from Loqate and puts them into a colleciton.

I used a context variable called “searchVisible” to set the visibility of the address lookup controls.

Back in the actual form I just set the default property of the dataCardValue text controls to:

First(AddressDetails).Company
First(AddressDetails).Line1
First(AddressDetails).Line2
etc

Download the flows to import into your environment here:

Flow 1 – Loqate Interactive Find
Flow 2 – Loqate Retieve

And that is how easy it is to add Address Lookup functionality in PowerApps! Any questions, just ask.

Filed Under: Power Platform Tagged With: Power Automate, PowerApps

Combine SharePoint API & Flow Parallel branches for Performance

April 19, 2020 by Paulie 8 Comments

This post covers how to configure a Power Automate Flow to get items from a SharePoint list at maximum speed. Super useful if you have an interactive process and you do not want to keep users waiting.

This post is part of a three part series of blog posts, before proceeding please read this post which describes the objectives, pros and cons of each method. It also provides links to the exported flows and sample data which I used to build the flows:

The many ways to retrieve more than 5,000 items from a SharePoint list using Power Automate

If you have not used a parallel branch before, this blog post is worth reading.

Before getting into the technicalities, have a look at the complete flow. If you have already built the more SharePoint API version detailed in this post, it will make sense.

Image of an entire Power Automate Flow that uses Parallel Branches to get records from a SharePoint list

General Premise

This flow retrieves the SharePoint items using the same method as the flow provided in this post. But the work of collecting data from SharePoint is split over four parallel branches, which execute at the same time. Instead of waiting for a single batch of 5,000 to be collected before proceeding to get the next batch.

Changes from the SharePoint API Flow

Several changes were made to the SharePoint API flow:

Variable Declarations

There are some extra values declared and defined at the start of the flow which control how the four branches choose which section of data to return:

Get the Lowest ID from the SharePoint list using the REST API

The lowest ID from the list is retrieved using the HTTP request to SharePoint action and uses the following code:

_api/Web/Lists/GetByTitle('5000 Item Test')/Items?$select=ID&$filter=ID gt 0&$top=1&$orderby=ID asc
Image showing Sharepoint API being used to find the lowest ID of a row in a SharePoint list

Get the Highest ID from SharePoint list using the REST API

Same as the above flow step, but repeated to get the highest ID, uses the following code:

_api/Web/Lists/GetByTitle('5000 Item Test')/Items?$select=ID&$filter=ID gt 0&$top=1&$orderby=ID desc

Gets the Total Item count from the SharePoint List using the REST API

The total item count of the list is returned by using the ItemCount method of the SharePoint API:

_api/Web/Lists/GetByTitle('5000 Item Test')/ItemCount
Image of the SharePoint API being used to get the total item count of a list.

Declare the control variables for each parallel branch

Because there are four parallel threads, all of the variables which operate within each branch are declared four times.

In the previous example, there was a single integer, array and boolean variable to control the do until loop that was retrieving SharePoint data. Now those variables need to be declared for each parallel branch:

Image showing four arrays being defined in Power Automate, ready for parallel execution.

The main control block for the Parallel Branches

In the control block for the parallel branches, a compose action is used to divide the total item count by four to determine the amount of data each branch should retrieve:

div(variables('itemCount'),4)

The control mechanism for the do until loops was modified to be more efficient, by changing the step which checks if there were no results from SharePoint

if(
	empty(body('HTTP_to_SharePoint_to_get_First_Quarter_of_Results').value),true,
	if (
		less(length(body('HTTP_to_SharePoint_to_get_First_Quarter_of_Results').value), 5000),true,false
	)
	
)

This removes an iteration of the loop, by checking if either of the following conditions are true:

  • The result set from SharePoint was empty
  • The number of results returned from SharePoint was less than 5000

SharePoint API Query for each branch

The SharePoint API query is different for each parallel execution of the data collection.

Each branch collects data according to the batch size defined by dividing the total item count by four and begins at the lowest ID in branch one. ?Next, branch two begins at the end of branch one and so on, so that all items are collected.

Branch 1

_api/Web/Lists/GetByTitle('5000 Item Test')/Items?$select=ID,EmpNo,Title,Last,Furloughed,Telephone,Email,Brand&$filter=ID gt @{variables('intID')} and ID le @{add(body('getLowestID')?['value'][0]['ID'], mul(outputs('DivideTotalByFour'), 1))}&$top=5000"

Branch 2

_api/Web/Lists/GetByTitle('5000 Item Test')/Items?$select=ID,EmpNo,Title,Last,Furloughed,Telephone,Email,Brand&$filter=ID gt @{add(body('getLowestID')?['value'][0]['ID'], mul(outputs('DivideTotalByFour'), 1))}  and ID gt @{variables('intID2')} and ID lt @{add(body('getLowestID')?['value'][0]['ID'], mul(outputs('DivideTotalByFour'), 2))}&$top=5000

Branch 3

_api/Web/Lists/GetByTitle('5000 Item Test')/Items?$select=ID,EmpNo,Title,Last,Furloughed,Telephone,Email,Brand&$filter=ID ge @{add(body('getLowestID')?['value'][0]['ID'], mul(outputs('DivideTotalByFour'), 2))}  and ID gt @{variables('intID3')} and ID lt @{add(body('getLowestID')?['value'][0]['ID'], mul(outputs('DivideTotalByFour'), 3))}&$top=5000

Branch 4

_api/Web/Lists/GetByTitle('5000 Item Test')/Items?$select=ID,EmpNo,Title,Last,Furloughed,Telephone,Email,Brand&$filter=ID ge @{add(body('getLowestID')?['value'][0]['ID'], mul(outputs('DivideTotalByFour'), 2))}  and ID gt @{variables('intID3')} and ID lt @{add(body('getLowestID')?['value'][0]['ID'], mul(outputs('DivideTotalByFour'), 3))}&$top=5000

Compile all results and send back to PowerApps

The response step simply uses a Union action to bring all the SharePoint data back in a single step:

union(variables('arrItems'),variables('arrItems2'),variables('arrItems3'),variables('arrItems4'))

Summary

Using Parallel branches to fetch SharePoint data can provide a huge speed benefit over a standard do until loop at the expense of creating a more complicated flow but it can be worth it to provide the best possible user experience.

It may be easier to just download the exported flow and modify to your requirements than build it from scratch.

You can download the flow and sample data from this post.

Filed Under: Power Platform Tagged With: Power Automate, PowerApps, SharePoint Online

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Primary Sidebar

Link to my LinkedIn Profile
Buy me a coffee

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 246 other subscribers.

Go to mobile version