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

Tachytelic.net

  • Sco Openserver
    • Sco Unix Support
    • SCO Openserver Installation ISOs
    • SCO Openserver Binaries
    • Add a Hard Drive to an Openserver 5 Virtual Machine
    • Install SCO Vision SQL-Retriever ODBC Driver on Windows 10
    • License Expired on Virtual SCO Openserver Installation
    • How to reset the root password on SCO Openserver 5
  • Scripting
    • PowerShell
      • Add leading zeros
      • Check if a File Exists
      • Grep with Powershell
      • Create Environment Variables
      • Test for open Ports
      • Append to a Text File
    • VBScript
      • Check if a File Exists
      • lpad and rpad functions
      • Windows Update E-Mail Notification
  • Office 365
    • Connect to Office 365 with PowerShell
    • Add or remove an email alias using Powershell
    • Change Primary email address of Active Directory user
    • How to hide an AD user from the Global Address List
    • How to hide mail contacts from the Global Address List
    • Change the primary email address for an account with PowerShell
    • Change Primary email address of an AD User
    • Grant a single user access to access to all calendars
    • Forward email to an external address using Powershell
    • Convert shared mailbox to user mailbox with Powershell
  • Get in Touch
  • About Me
    • Privacy Policy

PowerApps

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 10 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 5 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

Solutions to the SharePoint 5000 item limit using Power Automate

April 19, 2020 by Paulie 16 Comments

If you need to get more than 5000 items from a SharePoint list, there are a number of different approaches. I’ve written up three different ways to solve the problem, which return exactly the same result, but have very different execution times. To get an overall understanding of this problem, check out the YouTube video I produced:

My requirement is to return 17,000 SharePoint list items to a PowerApp. I used Power Automate to get the data but found the standard “Get Items” action to be too slow. A good user experience is essential for application acceptance.

Eventually, I was able to reduce the amount of time that the Flow takes to retrieve the items from 2 minutes down to 8 seconds! That’s 13 times faster!

Since I originally wrote this post, I have figured out a method that is even easier and faster! Check it out here.

Links to my sample data and all the flows created are at the end of the post.

My example data looks like this:

Image showing data from SharePoint list which is going to be used as a DataSource for a flow

It’s 7 columns wide, 17,000 rows of data. Here is how long it took Power Automate to execute the flow with execute each method:

Method Time to Execute
Standard “Get Items” 111 Seconds
Standard “Get Items” with Select Action 67 Seconds
Retreiving same data with SharePoint API 31 Seconds
Retreiving same data with SharePoint API and two parralel queries 19 Seconds
Retreiving same data with SharePoint API and four parralel queries 13 Seconds
Same as above with optimised flow 8 Seconds

The table shows the results from six variations on three different themes. The fundamental principal behind each method is a “Do until” loop which collects the entire contents of a SharePoint list into an array. Each method has some pro’s and cons.

Which method to use?

The right method to use, depends on your circumstances. Here are some suggestions on what method may work best for you:

  • If your flow is not time sensitive, just use the standard “Get Items” action with a “Do Until” Loop in Power Automate. The flow is simple and easy to build.
    Get more than 5000 items from SharePoint with Power Automate
  • If you are already using the “Get Items” method but need it to be a bit faster, enhance the speed of it by adding the “Select” action.
    Get more than 5000 items from SharePoint with Power Automate
  • If the performance gained from the “Select” action still does not meet your requirements, switch to using the SharePoint API. It is almost the same as using “Get Items”, but drastically faster.
    Use the REST API in Flow to get over 5000 items from SharePoint
  • Finally, using parallel execution to retrieve chunks of SharePoint list data simultaneously increases speed further. But it does make the flow more complicated.
    Combine SharePoint API & Flow Parallel branches for Performance

Why is the SharePoint Get Items action so slow?

The “Get Items” from SharePoint in Power Automate is very slow. The primary reason is the size of the payload that it returns from SharePoint. In addition to returning the columns defined in your SharePoint view, it also returns many other columns and metadata.

A single row of the sample data above results in this from SharePoint:

{
	"@odata.etag": "\"1\"",
	"ItemInternalId": "1",
	"ID": 1,
	"Title": "Terry",
	"EmpNo": 1.0,
	"Last": "Carter",
	"Furloughed": 1.0,
	"Telephone": "(462) 723-7695",
	"Email": "[email protected]",
	"Brand": "PowerBI",
	"{Identifier}": "Lists%252f5000%2bItem%2bTest1%252f1_.000",
	"{IsFolder}": false,
	"{Thumbnail}": {
		"Large": null,
		"Medium": null,
		"Small": null
	},
	"{Link}": "https://accendo1.sharepoint.com/sites/DocumentManagementTest/.....",
	"{Name}": "Terry",
	"{FilenameWithExtension}": "Terry",
	"{Path}": "Lists/5000 Item Test1/",
	"{FullPath}": "Lists/5000 Item Test1/1_.000",
	"{HasAttachments}": false,
	"{VersionNumber}": "1.0"
}

That’s a huge amount of extra fields, which results in a massive payload. 5,000 rows of my sample data created a JSON response which was 3,545 KB.

The same 5,000 rows of data when passed through the “Select” action produces a JSON response which looks like this:

{
	"Id": 1,
	"Title": "Terry",
	"EmpNo": 1.0,
	"Last": "Carter",
	"Furloughed": 1.0,
	"Telephone": "(462) 723-7695",
	"Email": "[email protected]",
	"Brand": "PowerBI",
	"ID": 1
}

For the same 5,000 records, the JSON response in flow was only 772 KB – A massive reduction. So passing the response from Get Items through the select action can make a big difference to how quickly your flow will run, and it is super easy to do.

Image of output of Sharepoint Get Items action in Power Automate being reduced down with the select action.

Use the Sharepoint API for maximum speed

Although the “Select” action in Power Automate described above improves the speed of a flow within a do…until loop, the “Get Items” action is still retrieving a lot of unwanted data from SharePoint.

Using the SharePoint API allows you to get exactly the data you want without retrieving any unwanted columns or metadata.

Fortunately, this is very easy to do using the SharePoint API using the “Send an HTTP request to SharePoint” action. Compare these two flow actions:

Standard “Get-Items” action.
The same request using the SharePoint API

These two actions, essentially perform the same operation, but the second one returns only the requested columns. Here is the difference in execution time:

Image displaying the difference in execution time between Power Automate Get Items from SharePoint Action and the Same request to the SharePoint API.

Use Parallel Branching to get batches of 5000 items simultaneously.

Using the SharePoint API to get list data into Power Automate makes a huge difference to the speed of the operation. But it still gets the data in batches of 5000 blocks. With my 17,000 row sample the do-until loop has to execute four times to collect all of the data, all of which takes valuable time.

By using the parallel branch actions in Microsoft Power Automate we can engineer a solution which works much faster.

I tried collecting SharePoint data with two and four parallel branches. With four, I was able to get all 17,000 items in 8 seconds. The downside is that the flow is more complicated.

Conclusion

The standard Get Items action in Power Automate is fine for basic operations, but if you need more control, or speed, then there are better options.

I’m happy with the performance improvements I managed to create. Retrieving data from SharePoint is key to many applications and SharePoint handles the simultaneous requests well.

Example Data and Flows

You can download both my sample data and the flows discussed in these posts from here:

  • Test Data to upload to SharePoint list
  • v1 – Using the Get Items Action
  • v2 – Using the Get Items Action with Select action
  • v3 – Using SharePoint API to retrieve items
  • v4 – Using SharePoint API and Two Parallel Execution Branches
  • v6 – Using SharePoint API and Four Parallel Execution Branches

Adapting the flow to return SharePoint data to a jQuery grid

In the YouTube video above I also provided a demo of a jQuery grid that drew data from the SharePoint list using Power Automate, you can view that demo here:

Demo of jQuery based grid retrieving SharePoint data via Flow

You can easily copy the source code from that page, the flow has been left unsecured so that you can try it out.

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

Use the REST API in Flow to get over 5000 items from SharePoint

April 19, 2020 by Paulie Leave a Comment

This post describes how to use the SharePoint API in Microsoft Power Automate to retrieve over 5,000 items from a SharePoint list. It is the second part of a series of blog posts which covers this topic in detail. Please read this post to get an overall picture of the objective and to download my example data and exported flows:

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

The SharePoint API can be a better option than the “get items” action, because it executes much faster. This post builds on the flow created in the previous post which you should read first:

Get more than 5000 items from SharePoint with Power Automate

The aim is create a simple modification to the flow created in the previous post, to improve performance. The previous flow works fine, but it’s slow. If you need to return data to an interactive process, the execution time may be unacceptable.

In the previously created flow the data from the “Get Items” action was passed into the “Select” action like this:

Image of the Power Automate Get Items from SharePoint Action being reshaped by the Select action

This method works, but uses “Get Items” to retrieve data from SharePoint and then “Select” action to reshape it. Both actions can be replaced with a single request, like this:

Image of the Power Automate action "Send an HTTP Request to SharePoint" accessing the GetByTitle method

By requesting only the required columns, the need to reshape the data with the select action can be removed. The Uri code above is:

_api/Web/Lists/GetByTitle('5000 Item Test')/Items?$select=ID,EmpNo,Title,Last,Furloughed,Telephone,Email,Brand&$filter=ID gt @{variables('intID')}&$top=5000

Using Power Automate, with my sample data, the “Get Items from SharePoint” took 12 seconds to complete the request to SharePoint, whereas the API method took just 1 second:

Image showing how fast a SharePoint API request is compared to the Get Items action in Microsoft Power Automate.

It’s simple to replace the “Get Items” action with the API action and the execution time is greatly improved. You can also specify any odata filter query that you like, to speed up the action by reducing the results further.

Reduce the metadata output

It’s really important when using the SharePoint API to reduce the metadata output for the fastest possible results. As show in the image above, be sure to include the following in the request header:

application/json; odata=nometadata

This reduces the output payload from SharePoint to contain only the list item data. There is a good explanation of all the options on this Microsoft Blog.

Summary

Getting data from SharePoint lists using the SharePoint API is easy and can provide a significant performance increase over the standard “Get Items” action in Microsoft Power Automate.

It provides the basis for the next post in this series which details how to use parallel execution actions in Flow to get the data even faster:

Combine SharePoint API & Flow Parallel branches for Performance

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
Go to mobile version