Posts

Showing posts from May, 2022

Power Automate Tip #7 : Note, Commenting your Activity

Image
 There is nothing intelligent in this post, its more abut good practices. When you write an acitivity you make sure you name it right so its easy for you to decode the logi. Its not just you, anyone who is reviewing is going to get a handle of it right away. If you like to learn more about renaming, see this post . Now lets say if you need to write a descriptive comment on a complex logic, then we may need more real estate for commenting, thats when you use the note. Its a simple step, click on the Activity and Click 'Add a Note' option something as shown below and you should be able to get your comments in place. Hope that helps.

Power Automate Tip #6 : Name it Right

Image
 Renaming the activity is like commenting your code. It would take probably 10 extra seconds for naming your activity appropriately. This will save a ton of time when you are in the process of debugging or decoding the logic during adverse times. For the simple flow that runs ' Runs at 6:00 on Monday every week'  and extracts the members of an Office group and email the details, looks like this. It will look much better if the activities are renamed as per the logic. Please do understand you ca write big comments on these activities which will cause trouble when you are trying to use the output of this on to expressions. If you like to use bigger comments, you may need to use the 'Add a note' option. Learn more about 'Add a note' in another tip written here .

Power Automate Tip #5 : Use Clipboards Effectively

Image
 A lot of times there is always a need to make a copy of a flow activity on to another flow or even to another tenant. Building this from scratch is a pain or I would consider that as a duplication of effort. So, the best feature that I would recommend is to use the Clipboard. This feature is on preview. If you click the three dots on the activity, you should see an option to 'Copy to my clipboard'. Once you copy, you can create a new activity either in the same flow or another on the same browser session and try to use the copied clip and use it on to your flow by going to the 'My Clipboard'. If its another browser session, you can past it on a notepad which would looks something like this. You can select all and cut the json and past it on the My Clipboard area so you could get back the action. Simple, easy and I love the fact that it saves a lot of my precious time

Power Automate Tip #4 : Experimental Features

Image
 The Experminetal features for your Power Automate Settings are of great use. To enable this, Go to Settings>View All Power Automate Settings and Turn On Experimantal Features and click SAVE. Please refer to Microsoft post for more details - https://docs.microsoft.com/en-us/power-automate/experimental-features One of the feature I like about is the real estate that we have for keying in your expressions.

Power Automate Tip #3 : Trigger Conditions

Image
One of the best practices is for you to govern your flow/power automate runs. One of the way to do such thing is to use the Trigger Conditions. For the same example I used before - I would like to take the files that are not already compressed. The very first thing you need to do is to click the settings of your Trigger. In my case its the When a file is created or Modified on the SPOL library.  In my case, I would like to have two conditions,  1. I am compressing the PDF's and nothing else. 2. The Compressed value should not be True If you see above thats how I can set the above conditions using Regular Expressions. Hope thats helpful!

Power Automate Tip #2 : Use of Compose & Parse JSon

Image
I am going to use the same use case (compressing the PDF using Adobe) that I used in my previous post and show how we extract the error message that's thrown by the Adobe Compress Plugin. Compose is a very powerful action in Power Automate.  The result of the Adobe Compress looks like this when there is a failure To extract the appropriate field, you have to compose the result that comes out of the Adobe and use the ParseJson which parses the Json so its easy for you to extract the appropriate property. It has to be a step by step procedure.  1. You have to do the Compose and make a run. 2. Extract the Output and use it on the ParseJson Action. Use Generate from Sample and paste your Compose output from the previous run. 3. Now you should see these attributes available to be used in the subsequent steps as you see below

Power Automate Tip #1 : Use Scope

Image
There are occasions where your flow breaks at a specific step and you may notice the flow run fails entirely which means you may end up troubleshooting the flow run periodically. Scope is an action that covers the specific step or a sequence of steps and you could capture the failure of these steps so you could perform the appropriate actions based on the success or failure. For instance, here is an use case where I would like to compress a PDF file once uploaded on to a SharePoint library using Adobe Compress and set the Compressed field to Yes so it doesn't try to compress again. Lets say if someone uploads a file that's already compressed, it will throw an error at the Compress PDF and there wont be any log of it.  The better way to handle is to do the following : 1. Use a Scope and make a parallel activity (One configured run after - has failed of Scope and another is successful with the success activity) 2. On the success, do what you need to do on success 3. On Failure, 

Power Automate UseCase : Compress PDF & AI files

Image
One of my customer's graphic team use heavy PDFs and they also gather these Proof heavy PDFs from third party vendors. Storing all these as-is not so optimal in the SPOL library and it takes time to load, share and annotate. The quickest solution that I could think of is to use the Adobe Power Automate plugin  and compress the PDFs as soon as it gets uploaded. Having a column called 'Compressed' and set it to true on successful compression helps redundant run of the flow.  The first trigger has to have some kind of trigger conditions so it just compress PDF files and also if the Compressed column is not true. Remember, Adobe compress throws an output error if you pass the compressed file. Also, you don't want to make a call and lose the credits.  Next, Get the file Content and pass it on to the Compress PDF. Follow the above help link to how to get the ClientID and set up the plugin. The output of the Adobe Compress activity is your compressed file content. However you