Posts

Showing posts from June, 2022

Power Automate Tip #15 : Flow instance URL is Key for logs

Image
When you handle exception (read the post that talks about handling exception), you log your way (either on a list) or email yourself but then you need to know which instance failed. The 28 day history could be a BIG long list and it could be hard to find which instance that you are looking for. Here is the expression that you could use to get the flow URL.  concat( ' https://us.flow.microsoft.com/manage/environments/ ',  workflow()?['tags']?['environmentName'] , ' /flows/ ',  workflow()?['name'] , ' /runs/ ',  workflow()?['run']['name']   ) When you use this expression, the output would look something like this. Log this and use it to get back to the instance any time.

Power Automate Tip #14 : Handle Error

Image
 As you know Power Automate have plenty of connectors and some are third parties and they respond back with your expected result or maybe with some error message stating something is wrong. Sceanrios where we may need to handle two different things on success and on failure. Lets say we call a Adobe Compress to compress a PDF. The adobe typically sends back the compressed PDF content if the compression is successful. Check the use case here . 1. Scope the activity where you are making the call 2. Make a parallel step and use one for success and another for failure 3. On the success branch, overwrite the file (the compressed version) 4. On the failure, extract the output message and log it.    

Power Apps - Restricting the Text Box only Whole Numbers

Image
 We can restrict the a Text box to allow only number by making the Format TextFormat.Number as below.  But this will allow decimal Number. We can restrict the Text Box to allow only whole numbers by writing the formulae for the TextBox Onchange as below If(     DataCardValue1.Text <> "" And Value(DataCardValue1.Text) <> RoundDown(         Value(DataCardValue1.Text),         0     ),     Notify("Please enter number without decimals");     Reset(DataCardValue1) )

Power Automate Tip #13 : 28 Day Run History

Image
 Please do bare in mind the flow run history won't last more than 28 Days. This is as per GDPR requirements and you should make sure you download the history of it every 28 days.  There is an option to download the previous 28 day runs when you click the 'All Runs'. By clicking the 'Get .csv file' you should be able to download the flow run history. Looks something like this. Run link gets you the flow run.

Power Automate Tip #12 : Use Solution

Image
One of the best practice to create flows is to create it under a Solution. This is going to be extremly helpful if you like to govern your flow from Dev to Test and to the Production environment. Scenarios where IT Consulting companies build the flows for their clients should take advantage of this feature where they could easily create a solution and package it and export,  import the entire solution including connections (substituted to the customer's connections) into the Customer's environment.  Create new solution by clicking the 'New Solution' and build your flows under it. All the connections you build on the flow will continue to stay on the solution so its easy for you to package. You can export the solution by publishing the solution, check for issues and you can port it as a 'Managed' Environment for Taking it to Production or take it as a Unmanaged version if you think you could take it to a source control. A zip package will be downloaded and you ca

Power Automate Tip #11 : Share Your Flows Export and Import

Image
 You have few options to share your flow.  1. You want someone to work on the same capacity as you are, make them as a co-owner. 2. You want to send a copy of your flow in which case you have to select the 'Send Copy' and choose the appropriate person to whom you like to send a copy of it. Once that person consents after getting the email, a flow should be re-created for that user. The best thing is all connections will be run on that user account.  3. You cna also export the file as a Zip package by clicking Export.

SP 2013 Workflow Instance Suspended : There has been an error authenticating the request

One of my customer are still on Old 2013 on-prem Provided App hosting model and every now and then, the workflow instance chokes and gets suspended with an error message 'There has been an error authenticating the request'. This is very annoying and there is nothing you could other than recycle the  SecurityTokenServiceApplicationPool   application pool in IIS, And then you have to go to individual failed instance and Terminate and resubmit all suspended workflows. RequestorId: 847a8tdb-8a23-bc5a-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 401 {"error_description":"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information bac

Power Automate Tip #10 : Validate your flow or Testing your Flow

Image
 Lot of times you could notice a flow can fail for a specific run, specific data or specific scenario. The good thing is the flow records it, However if you need to modify and need to test the same data, Its hard for your to trigger the same scenario. To ease this MS have given a way of resubmitting a run that failed. There is an option called Test on the top right side of the flow. This have two options Manual and Automatic. By choosing manual you may need to manual do the trigger condition by updating or uploading (based on what your trigger condition is) to test the flow. By choosing Automatic, you can go to one of the recent runs you did that failed and test the flow run post change. This is a fantastic feature starting to finish - start building a flow to Final flow version. 

Power Automate Tip #9 : Parallel Branching

Image
Parallel branching is helpful if we have actions that can run independently which in turn reduce the flow runtime. Nobody wants our flow to run for a long time. So, this is one way by which you can reduce time. Make sure there is absolutely no dependency between these parallel actions. Instead of adding an Action, you can do the 'Add a parallel branch' which will create a parallel activity branch where you can run your independent actions. Lets say if we like to do two independent actions - 1. To email the Yearly Budget and 2. Send out the VP's number to a Teams chat. We can do that as shown below :

Power Automate Tip #8 : Format Number

Image
 This is a cool new activity feature that does the formatting for you. You can  use this activity to format the numbers/Variables to a desired format. You can pick one of the 3 available formats or you cna pick up a custom format. For the below example, lets take an Yearly Budget and a USA Phone number. You could format this as shown below.  The output would look something like the below.