Category Archives: Power Automate
Last and First expression in Cloud Flows – Part I
Let see how we can use last and first expression in Cloud Flows. We can use last and first expression get first and last value in array, strings and also we can use first and last expression to get first and last record from list of records in cloud flows Let get started!!!!! Let say you have string named “A Datum Integration” and we want first character of the string, then use below expression. Syntax – first(<string>) I have initialized a string “A Datum Integration”. Add a compose and use first as below. As a result, will get a first character from the string i.e A Output – 2. Similarly, we can use last expression to get last character from the string. In this case character “n” should be output Syntax – last(<string>) Output – Stay tuned for Part II.
Share Story :
Send an email to users in a D365 Team Individually using power automate (without using a distribution list)
D365 gives us a functionality to assign a record to a group of users which can be archived by using a D365 Team these users then are know as members of that respective team, due to functionality restrictions we cannot send an email to a D365 team, however there are a few workarounds by which we can achieve this functionality. Lets consider a very case.Suppose we have a D365 team called as “Accounts Associates” we have added a set of users in this team. Now if an invoice milestone is in the ready state i.e. “Ready For Invoicing” we need to send a reminder email to this “Accounts Associates” team to take an action regarding the ready invoicing Solution :- The following case can be achieved by Looping through all the users in of a D365 Team.Lets Begin with the Implementation. Step 1 – Create a D365 Team.Go to Security – > Teams -> Create a new team. Step 2 – Create a Flow to send email.1. Flow triggers when Project Contract Line is Updated, Condition Invoice Milestone is Ready for invoicing for which click on the “…” select settings and add the following condition in the trigger section. 2.Get the Teams ID in this case I have hardcoded the ID as no record was associated with it to retrieve it3.Get the Teams Details.4.Get the User Details by using the following fetch XML Query. 5. Query :<fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”true”> <entity name=”systemuser”> <attribute name=”fullname” /> <attribute name=”businessunitid” /> <attribute name=”title” /> <attribute name=”address1_telephone1″ /> <attribute name=”positionid” /> <attribute name=”systemuserid” /> <attribute name=”internalemailaddress” /> <order attribute=”fullname” descending=”false” /> <filter type=”and”> <condition attribute=”internalemailaddress” operator=”not-null” /> </filter> <link-entity name=”teammembership” from=”systemuserid” to=”systemuserid” visible=”false” intersect=”true”> <link-entity name=”team” from=”teamid” to=”teamid” alias=”ag”> <filter type=”and”> <condition attribute=”teamid” operator=”eq” uitype=”team” value=”{Your Team ID}” /> </filter> </link-entity> </link-entity> </entity> </fetch> For all the users Send an Email individually to the user OutputUser 1. Which is CRM Admin in my case in the team. User 2 Vidit Gholam system Administrator Hope that helps. !
Share Story :
Parse JSON and update excel using Cloud flow
Introduction: If you have an Excel with data in JSON format and do not want to use Excel Power Query to transform JSON, you can use the below actions in Cloud flows. Solution: Create a Manual trigger flow and upload the Excel with JSON data on SharePoint. Use List rows to read the excel data For every record in Excel, use the Parse JSON Action. After every parse, append the value to Output array with a comma. Use substring expression to remove the last comma of the appended value and store the new value. Then use Update a row to update the Output to same Excel.
Share Story :
Last and First Expression in Cloud Flows – Part II
We have already seen how to extract character from string in Cloud flows. Let see how we can get first and last value in array. I have array of list of records (account records), want to get 1st value in array. Array – Add a compose step in flow and use below syntax to get first value. Syntax- first(<array>) Output – Similarly, we can get last value in array. Syntax – last(<array>) Output – Hope this helps !
Share Story :
Multi Select Option Set is not visible in Cloud flow Trigger Body
Problem Statement: I triggered a Cloud flow and expected to get the multi select option set value as part of triggered body. However, the trigger body does not show the field. I checked with Common Data Service(Current environment) and Common Data Service Connector as well. Solution: This is more of a workaround, we do not get the multi select option set field, so we will use Get a row action to get the record that was created.
Share Story :
Loop on Multi Select Option Set Values Using Cloud flow
Problem Statement: We wanted to run an action on all the selected values in a multi select option set(choice).We get the data in a comma separated string. Solution: 1.When we get the values in comma separated values, we will need to convert the string to an array format. Formula: array(split(Input comma separated data),’,’)) 2. Get the output from the compose step and add in parse Json to create a Json object. 3.Add an apply to each on Json body and you can use the item(apply_to_each) to access the data from the Json object. Conclusion: Instead of complicating the flow with switch or if condition to check the data and then run the flow, we can loop on Multi select option set value using apply to each action.
Share Story :
Post Message in MS Team when Code is Checked-in Azure DevOps TFS
If you want to keep track of the Commits of any Critical Project and want to discuss with your Project Team Member regarding commits made on TFS. We can create a flow that will post the Commit details of that Critical Project on your Project Channel. Step 1: Create a Team and a channel to post the Checked-in Details. Here I have created a Team with the name “Project Team” and a separate channel “Azure DevOps” to post all the messages related to Development and DevOps. Step 2: Create a Cloud flow to post Message when someone commits any changes in Azure DevOps (TFS) Search for Azure and select the triggering condition as “When code is checked in (TFVC)” Configure the Triggering block with Project for which you want to post a message to MS Team. If you want to track the commits of any specific user then you can set a user in Team Member otherwise it will post a message for all checked-in commits made by all Project Members present in Member. Now, we will add Post a message (v3) block in Cloud flow. Make sure that you should select the right channel while configuring the post message block, after configuring your block it should look like the below screenshot: Save the Cloud flow and Test it by making commits from your Visual Studio or Azure DevOps from the browser. Testing. Here, I will make commit using Visual Studio: Result
Share Story :
Sort records in Cloud flows
In this blog we will see how we can sort list records in Cloud flows Lets say we want to retrieve all accounts on created by ascending. There are two ways to sort list of records in Cloud flows Order By – Fetch Xml – Order By – Use List Records step in Common Data Service Connector where all you need to specify is field schema name and Order (Asc/ Desc ) Syntax – Schema_Name asc/desc 2. Fetch XML We can use Fetch XML to retrieve only the attribute that you need based on Condition that can be easily added using advanced find. While adding condition we can specify the order in Fetch XML 1. Click on Configure Sorting 2. Add Sorting – Sort By -> Ascending Order and then download Fetch XML. Below is the downloaded Fetch XML – 3. Use this Fetch XML in Flow Hope this helps !
Share Story :
Send Email to not resolved Email Ids from Workflow/Cloud flows
Introduction: We might have a requirement to send emails from Workflow/cloud flows to Ids that cannot be resolved as Contacts, Accounts, Users in CRM. Solution: We need to make changes to system settings to allow messages to unresolved recipients In case of Workflow, directly add email address in the field( It will show ? as it is not resolved address) For Cloud flow, in create a new email record, click on “Switch to Input entire array”, populate the email in addressused field. This will let you send emails to an unresolved email address.
Share Story :
Flow to Replace Special Characters from any text Field in Dynamics 365
Consider a case where users create a record say an opportunity. The name of the opportunity may contain special characters such as ampersand “&” and many more. This might not look like an issue, but these special characters are not accepted if you are trying to fetch a record using query expressions, that may be Fetch XML or any other. What to do in such case. There are certain ways in which this issue can be resolved. Replace the Special Character Using Variable in the flow itself. Replace the Special Character in the Record. Or Skip the Special Character. Let’s have a look on how to Replace the Special Character in the Record.Consider an Opportunity Record with name as Given Below. As we see that there is an “&” in the name – “COCS – Planning & Discovery“. This can be a cause for a Bad Request error while fetching this record using query expressions. Solution: – The Flow will run the flow when an Opportunity is Created. The Flow will get the Topic of the Opportunity. The Flow will Check if the Topic Name Has Any Special Characters If YES The Flow Will check which Special character it is and replace the Topic name Accordingly. After the name is being updated the flow will Update the Opportunity Record. If NO The flow will terminate successfully. Let’s Begin with the Flow Implementation. Process Flow: – Step – 1 The Flow will trigger when an Opportunity is being created. Step – 2 The Flow will get the Created Opportunity Record. Step – 3 Also we need to initialize an array of Special Characters as given below Step – 4 I have used a Special Character Array “createArray(‘&’,’|’,’/’)” according to my requirement for all special characters you can go with the below expression. Step – 5 “createArray(‘.’,’@’,’ß’,’²’,’³’,’µ’,’`’,’´’,’°’,’^’,’=’,'(‘,’)’,’&’,’$’,’§’, ‘~’,’#’,’%’,’*’,’:’,'<‘,’>’,’?’,’/’,’|’,’ ‘) “ Step – 6 The Flow will check if the Topic has any special characters. Step – 7 If Yes, it will replace & with “And” using the Filter query “replace(variables(‘Topic’), item( ),’ and ‘)” Step – 8 Lastly the flow will update the Topic of the Opportunity. Results Hope This Helps !.
