Posts

Showing posts from February, 2021

CRUD operation using Send request to SharePoint Action in Power Automate.

Image
 CRUD operation using Send request to SharePoint Action Send request to SharePoint Action is an important Action in Power Automate. Perfect use case for this Action will be when Out of Box actions are failing to do the job, like when your flow is failing to read the JSON that you have passed to it. This action can be used to do all the CRUD operations on SharePoint lists using the below methods. GET POST PATCH DELETE However, the best part I like about it is that you don't even need to refresh the SharePoint Pages to see the end result. Lets dig into this. We have a simple Flow testing list created in SharePoint. It has a Title column, a choice column and a People picker with single values column. GET Method. For all the flows that I showcase here I will only trigger them using Manual trigger. But that is no way a dependency and in actual practice you can trigger your flows based on any conditions and even from Power Apps and they will work like a charm. Site Address : Select your

Nesting Level limit in Power Automate.

Image
         In one of my Projects in which I was automating a SharePoint 2013 Stage workflow, I ran into a very interesting scenario, Flow starts to throw an exception that you have actually reached a limit for your nested structure and you can't create actions beyond it. This is really weird as in 2013 I never experienced this, but that may be because in 2013 we had a stage structure. To replicate the stage workflow we use a stage template. I have written another blog on how this is done. Please check it here for more info. So in our case we have 2 switch statements one for Phase and another for Status. Each having multiple options. But when you come down to these detail actions inside these status you sometime further need condition on a field. Like in my case i had my first level where in I check if the Threshold (Internal column) has value 199, then  But my third level comes in when i compare if my threshold has value 200 Each of yes and No statement has another switch inside it f

How to avoid infinite loops using conditional triggers in Power Automate.

Image
 This is one of the most common scenarios.  What happens is your Power Automate flow gets triggered on SharePoint list on item creation or modification. And then you have a condition in the flow which updates the same SharePoint list item column. But since the flow gets triggered on SharePoint list item modification the flow kicks in again. This sets the flow to be in infinite loop condition, where it gets triggered on item modification and its body is updating the same SharePoint list item. Now, to fix this we have to use conditional triggers. The logic behind this is that your flow should run via your service account. And then the update item action in the flow will also happen using the same service account.  We can then put in a condition that if the modifications to SharePoint item happens using this service account, the conditional trigger will prevent the flow to initiate. Lets dig into this now. what we are doing in here is  not(equals(triggerBody()?['Editor']?['Ema

Settings Items property of a Power App form via a Global Variable. Creating an item without using a New Form.

Image
 Today we will see an interesting scenario where in instead of setting the Items property to a list we assign it to Global variable. What happens in here is we use the same formula's that we use to patch a new item and patch an existing item into a list. But we tweak it a little. The advantage of this form is we don't need New Form, We can achieve everything using the EDIT form. So lets gets started.  Suppose you wish to open a New form.  All you will do is add the form on the screen. This form by default is EDIT, by EDIT i mean the display mode for this form is EDIT. So now we go to the screen from where we call in this from. Lets take an icon, you can even have a button if you want. Now OnSelect property of this button, we will need to initialize a variable that we will then put as the value of items property of the above form. Set(varFormData,Defaults(Programs));Navigate('Program Screen',ScreenTransition.Fade); What we do in here is we set a variable varFormData , an

Replicating a SharePoint2013 Stage workflow in Power Automate.

Image
 This is an interesting scenario. Now after MS has deprecated SP 2010 workflows, i got a request for creating a SP 2010 workflow in Power Automate. However, on my analysis I found out that the 2010 workflow was triggered by a SharePoint 2013 workflow. This made it very interesting as now I had to not only replicate the 2010 workflow, but also its parent  2013 workflow.  Now to make matters worse 2013 workflow was a long workflow with multiple stages and each stage having separate switch statement for comparing the values of Status. Power automate has no feature in itself to implement Stage workflows. But it has a prebuilt template of State machine process. We can use this to achieve State machine workflow. What we have in this template is a Do Until loop having a Switch condition . What this means is status is evaluated till it becomes equal to Completed. So it goes from one Switch condition to another and loops out when it becomes equal to Completed. Caution : Be very particular about