Category Archives: CloudFlows
Trigger Power Automate Flow using JavaScript – Bi-Directional
Hi All, This blog will be a continuation of my previous blog – Trigger Power Automate Flow using JavaScript – Uni Directional Now, feedback is essential when sending a request to determine whether it was successfully performed or failed somewhere. You can accomplish this by forwarding a response back from where the flow was invoked. I’ll use the same situation as in my previous blog, where I send a notification by greeting a person’s name if exists, or else I will greet a friend. Check out my previous blog to learn how to build your Flow and JavaScript. Steps to pass the response back within Flow Step 1: Add a response that will be sent back from where the Flow was invoked. Quick Tip: I am checking if ‘Name’ is present in my dynamic content. If yes, then greet the person else greet a Friend Formula: if(contains(triggerBody()?[‘DynamicData’], ‘Name’), triggerBody()?[‘DynamicData’][‘Name’], ‘Friend’) Steps to add into the JavaScript Step 1: Initially we created JS to trigger the flow, now we will add the code snippet to accept the response from Flow. Add the following Code: Step 2: Trigger the JS and watch the output I get as Alert (I have used the console page to trigger my JS for example purposes) Hope this helps in achieving a response from the Power Automate Flow!
Share Story :
Download SSRS report as a PDF with Power Automate – Part 2
In this blog, we will see how to extract the value for PdfDownloadUrl so we can load it into another request and get our PDF.
Share Story :
Get Option Set Labels in Power Automate flows
Every Option set Option has two Values associated with it : Label Value – which is a free text field. Value – Which is an integer value as In any Power Automate flow by default, we only get the integer value of an Option Set Option. In this blog let’s see we can get a Label of an Option Set Option. On my Accounts in CRM, I have an Option set Account Type. I have used a Get row by ID Action to get the Account Record whose Account Type Label I need to get. The next step is to check the Raw outputs of this Trigger Action and search for your Option Set field name. You will see 2 values in the body of the Raw outputs as shown below. Expression : outputs(‘Get_Account’)?[‘body/cfs_accounttype@OData.Community.Display.V1.FormattedValue‘] Gives the Label: Business Combination. Expression : outputs(‘Get_Account’)?[‘body/cfs_accounttype’] Gives the Value: 224520002. Inputs: Output : Hope this helps ! Thank you.
Share Story :
Get year from Current date & Time function in Cloud Flows
We wanted to get the current year but there is no direct expression only to get the year. Below is the solution where we get the current year. Use formatDateTime function function with Utcnow(). Below is the expression we used. formatDateTime(utcNow(),’yyyy’) Output – Expression to get current date formatDateTime(utcNow(),’dd’) 2. Expression to get the current Month formatDateTime(utcNow(),’MM’) Hope this helps!
Share Story :
Dynamically storing MS Forms Drop down field values into D365 CRM Option Set using Power Automate Flow
MS Forms offers a functionality to create a dropdown field which is similar to an option set fields in D365 CRM, But when it comes to mapping or storing values between these two field things become a bit tricky. However there are a few workaround using power automate capabilities. In this blog let’s see how we can store a MS Forms Dropdowns options into an Option Set field in CRM. What is an Option Set? Option sets are a field type that can be created within Dynamics CRM and are Often referred to as “dropdown” or a “pick-list”. An option set has two identities for each of its option. The Options Label Name and the Label Value as shown in the below snapshot. What is a Dropdown in MS Form ? A dropdown is a list of defined options(Choice) that can be selected by a user, unlike a text field where the data can be “organic” or manually entered. Now Let’s Consider an use case : Consider we have a MS Form Name “Company Registrations” when a user submits this form a Power Automate flow is triggered which creates a new Account record in CRM with the field mapping shown in similar colors in the below snapshot. Now we need to get the form responses first to create a new Account record. 2. All the Text field values can be directly mapped into the dataverse connector as shown in the below snapshot. 3. For mapping the MS forms Dropdown to the Option set we need to maintain the CRMs Option Label values into our flow as to set (define the value of the option set) Option Sets in CRM we need to pass the Label Values to the flow (if you just pass the label text it won’t work hence we need to maintain these option set values in the flow)as shown below. 4. Now we need to select the option set field in our flow connector and select enter custom value. 5. Once you are able to add a customer value use the following expression which will dynamically bring option set label value for the dropdown choice selected by the user on the form.Expression – outputs(‘Option_Set_Values’)?[outputs(‘Get_Form_Response’)?[‘body/rf98dd4fb83624fc7b7314de77542a3ef’]]Red : Text in the above expression corresponds to “Outputs “in the below snapshot which is the output of the compose in which we stored our option set label values. Blue : Text corresponds to the “Ownership Type” from the form response. Output : MS Form Submission – Created Account Output – Hope this helps !
Share Story :
Creating HTML table using Power Automate
The Create HTML Table action in Power Automate is a useful tool, but lacks any formatting or styling options. In this blog, we’ll see how to create a HTML table in Power Automate. Use Case: When quote is marked as won, close opportunity as won and send Email to the owner of the Opportunity with below details – Email Subject – Opportunity Won! Email Body – Customer Name – Below Table- Solution:Step 1-The requirement is quote should be modified and marked as Won. Trigger on When Quote Modified. Step 2- Initializing the customer with variable actions Step 3- Put a condition that the trigger works only when quote is Won (status code=4), then change opportunity to Won. Step 4- On quote status marked as Won, update the opportunity as Won. Step 5- Listing Accounts associated with Opportunity Step 6- Use Compose: Data Operation and enter the required record URL. Edit the Id by entering the opportunity Id from dynamic content. Similarly for quote URL details as well. Step 7- Using select operation to create a required table in the given format. Using href tag place the outputs of opportunity link and quote link in the key section respectively. Step 8- Create a HTML table and enter the output table of select operation. Step 9- Create 3 new steps using Compose operation to remove the unrequired part of the URL using replace expression. Step 10- Create a new step using compose operation and enter the required CSS style for the table to be sent in the mail and attach the final output in the inputs. Step 11- Send an Email and enter the final output in the Email body. Step 12- Email sent This is how we create HTML table in Power Automate. Hope this helps!!
Share Story :
Read items from Array in Power Automate
Let us consider we have array [1,2,3] and want to read each value in Power automate. Let see how we can read array in Power Automate Step 1- Create array (here you can use your array) Here I have array [1,2,3] and now I want read each value of array in loop Step 2 – Add apply to each step In a apply to each step, Add output of array. In this case we have compose. Step 3 – Add action compose and use expression item() to read array from compose Now Save and try to run the flow. In this way you can read value from array in Power Automate
Share Story :
Create HTML Table from SharePoint List using Cloudflows
Introduction: In this blog we are going to see how we can create an HTML Table from SharePoint List. Here is an example of SharePoint List. Solution: You can trigger the flow as per your requirment. Also, in this example I am retrieving all items in the list, there are filter options avaliable. Use action: Get Items We will first initialize an array variable and then append all list values to array variable in loop. Finally we create an HTML Table from the Array. Conclusion: As per your requirment, you can populate the values in document instead of creating HTML table. Send the HTML table or Word Document in Email.
Share Story :
Create attachments in SharePoint when email arrives
Use case – we wanted to retrieve attachment when new email arrives in outlook and create same file in SharePoint Let see how we can achieve this! Step 1 – Flow triggers on when a new email arrives trigger from Outlook connection. Step 2 – Retrieve attachments and Create file in SharePoint. Add step create file from SharePoint connection. In Create file, Add site address, Folder path, File name, File Content. Here file Content is the Attachment content from Trigger and File Name should be Attachment name. Save the flow and try. Hope this helps!