Category Archives: Cloud flows
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 :
Trigger Power Automate Flow using JavaScript – Uni-Directional
Hi All, Did you know you can use JavaScript to trigger Power Automate flows and pass input data? So, I’ll show you how to do that, as well as how to pass strict structured data and dynamic schema in Power Automate. In the next blog, I’ll talk about Trigger Power Automate Flow using JavaScript – Bi-Directional Steps to follow for Initial Setup Step 1: Let’s create a Power Automate Flow and define the input JSON schema.Go to: Power Automate Create an Instant Flow with the trigger ‘When a HTTP request is received‘ Step 2: Let’s outline the input schema and then focus on the output in a ‘Compose’ block. I’ll describe two types of inputs. (Strict and Dynamic).Our strict schema will be identified by a specific pattern indicating how the input should be given.Our dynamic schema will be recognised by an unknown pattern, and input will not always be fixed. Click on ‘Use sample payload to generate schema’. Apply the following code, click on Done and you will see the schema in ‘Request Body JSON Schema’. Add a Compose Block to check the output of the request and save the Flow. URL will be generated and is ready to be used. Let’s now proceed to create JavaScript to trigger this flow Steps to follow for calling Flow using JavaScript Since I’ll show the code snippet, adjust it as per your use case. Note: Copy your HTTP Post URL from the trigger as it will be used in the JavaScript Step 1: Type the following code Step 2: Execute the JS with ‘TriggerFlow.Main()‘. Note: Make sure you pass Execution Context to the JS Step 3: Check your Power Automate Flow History and open the Run. That’s how Power Automate is triggered using JavaScript. Hope this has helped you 🙂 Next blog – Trigger Power Automate Flow using JavaScript – Bi-Directional
Share Story :
Remove duplicate values from an array using Power Automate Flow
Hello everyone! In this blog, we will demonstrate how to schedule a flow that sends emails to all the owners of opportunities using Power Automate Flow. Scheduled flows are the best option for actions that need to be automated on a schedule and will run at a specific time or date. For instance, using this approach, you might schedule a daily data upload to Dynamics 365 or SharePoint. Use Case: Power Automate flow sends a reminder notification to the owners of Opportunities. To avoid multiple emails being sent to the same owner, we need to remove duplicate email addresses. Step 1: Log in to the required Power Apps environment using URL make.powerapps.com by providing username and password, click on Create on the left-hand side as shown below, and click on Scheduled cloud Flow. Step 2: Mention the date and time. It will appear as this. Step 3: Initialize a variable ‘Email_addresses’ of type Array which will store all the email addresses. Step 4: Use List Rows to find the desired records from the required table. Select the table name. Also, I added the FetchXML code to fetch the required details of an entity. Step 5: Add an ‘Apply to Each’ loop and insert the previous step’s value. This is done so that the value in every iteration is stored in the Array Variable. Add a step of ‘Set variable’ to store the email addresses in the Array. Step 6: Add a new step ‘Compose’ and declare an empty array. This helps to save time when comparing with larger sets. Step 7: Apply the Union function which removes duplicate values. union(variables(‘Email_addresses’),outputs(‘Empty_Array’)) Step 8: Apply the Join function to extract the email addresses. join(array(outputs(‘Union_function_to_remove_duplicate_mail_Values_in_Array’)),’,’) Hope this helps!
Share Story :
Set multiple not resolved Email Ids as To Party CC Party & Bcc Party in D365 Email Message records using Cloud flows
Many a time it happens that we need to send emails that may be an email notification etc. to clients, with the power automate capabilities we can schedule, trigger, manually run, and do want not to automate these notification emails. But the road blocker to all of these is not resolved email IDs, i.e. email IDs that cannot be resolved as Contacts, Accounts, Users in CRM. We need to make changes to system settings to allow messages to these unresolved Id we have already covered this in the Blog : [https://www.cloudfronts.com/power-automate/send-email-to-not-resolved-email-ids-from-workflow-cloud-flows/] In this blog let’s see how we can set multiple not resolved Email Ids as To Party CC Party & Bcc Party in D365 Email Message records using Cloud flows ToParty, CCParty, BccParty are all Activity Parties and they have a ParticipationTypeMask integer value associated with them more on Activity Parties and Types in this link [https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/activityparty-entity?view=op-9-1] ParticipationTypeMasks are as below : Sender : 1 ToRecipient: 2 CCRecipient: 3 BccRecipient: 4 In Cloud flow create a new email record, click on “Switch to Input entire array”, populate the email in the address used field and ParticipationTypeMasks as shown below : 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 :
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 :
[Solved] The supplied reference link is invalid in Cloudflows
Introduction: When we add a new row in dynamics CRM, we might end up using the lookup data reterived in previous action. There might be times when the previous record has returned a null. In such cases we get the error- { “error”: { “code”: “0x0”, “message”: “The supplied reference link — contacts() — is invalid. Expecting a reference link of the form /entityset(key).” } } For this example; I was creating a new record and wanted to use the Account and its contact as lookup in my new record. The reterived Account did not have a contact and so my flow failed. Solution: Use the below if condition, In this condition- we are checking if the reterived contact is empty, if yes we are setting the lookup field to blank else we are setting the lookup value. Note: Please remove and add the quotes/ commas again ; if you are copy pasting the condition in your flow else it might show invalid expression.
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 :
Store Customer Voice Survey Response to Dataverse Custom Entity using Cloud Flow
In this blog, we will learn how to store the Customer Voice survey response to the custom entity as OOB entities which holds that response data is complex and data is stored in multiple related entities. Step 1: Create a Customer Voice Project and Survey Log in to the Customer Voice Portal and Create a new Project. Select a Blank Template and click on Next. After creating a survey you need to select the Environment location in which Customer Voice Data will get stored. To select the location click on See all environment. Select the Environment location and complete the configuration of the Project. Step 2: Add the Survey Form Fields. Now, we will add the fields that need to be filled by the target audience or based on requirements. After creating your Survey form, you can click on the Preview to view in Desktop and Mobile Mode. To share the form, click on the “Send” tab. There are three options by which you can share the survey form — Scan the QR Code, Embed the Form in Website or App, and share using a short link. I will copy the short link and use it to fill the survey form. You can also create Cloud Flow to automate the survey sending process. Comment down below if you want a blog on the same. Let’s see it in action, I have submitted one response in Survey that we have created. Customer Voice Survey CSD Entity: During the configuration of the Customer Voice Project, we have selected the environment location. In that environment, there are some OOB Entities that have been created to store the Customer Voice Survey Data in CDS / Dataverse. We will Open the CRM Environment and we will Advance Find for the “Customer Voice Survey”. After clicking on the result, you will see the survey that we have created from the Customer Voice portal is also visible in Dynamics 365 CRM as shown below screenshot. Open the Customer Voice survey record. Go to Related and select the “Customer Voice survey responses”. You will see the response that we have submitted after the creation of the Survey Form. Open the Customer Voice survey responses record. To see the responses to each question submitted by the Audience, open the Related “Customer Voice survey question responses”. Open any Customer Voice survey question responses record. You have two fields Question — Lookup to Customer Voice Survey Questions Response — String value of responses submitted by the audience. Link to Documentation:Entity Reference for Dynamics 365 Customer Voice Step 3: Create a Custom Entity and Cloud Flow. I have created a Custom Survey response entity that has the same fields to store the response when any audience submits the response. Step 4: Create Cloud Flow to store the responses to Custom Entity. Create a flow and the trigger will be “When a row is added, modified or deleted” Dataverse connector. Configure the Triggering Connect as shown below screenshot: Now, we will list all the records of responses. To do so we need to use the “List rows” Dataverse connector and configure it as mentioned in the screenshot. We will declare the Variable to store all the question responses. These variables will be used to create the new Custom Survey Response. We will add a switch case that will match the Questions and store the responses to the respective Flow variable. After adding all the switch cases, we will create a record in CDS / Dataverse using the “Add a new row” Dataverse connector. Save the Cloud flow and test it. Cloud Flow in action Hope this helps!!!
Share Story :
SQL Trigger not populating with Table in Logic App
Wondered How to solve SQL triggered Azure Logic Apps issue of not being able to select your table in dropdown? This blog will help you fix this issue.