Creating comma separated string using array collection in Microsoft Flow.

Hello Guys,

Today we will see how you can create a comma separated string using array. But before if you are new to our blog then do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends. 




We have come across many situation where we need to create a comma separated string using a collection. In C# we can achieve the same using string.join() method. consider a scenario where you need to create a comma separated string in Microsoft Flow. In this situation we cant use C# code, instead we need to write some expression. we will create one flow and see how you can create comma separated string.




As you can see in above image we have contacts associated with Blogger account. we will be creating a flow which will be triggered when account record is updated and we will create a comma separated string for all the contacts associated with that account. So lets start...

Navigate to https://us.flow.microsoft.com and select your environment.




Now click on Automated Flow in the Start from blank section. It will open a new window. Fill the details as below and click on create.




Now configure the firs step as below.




Click on New step and search for Initialize Variable and configure the next step as below.




Now Add new step. In this step we will be retrieving list of contacts. Search List records and select Common data service option and configure it as below.




So now we have the list of contacts. we will be adding the First Name of the contacts in the array which we have created. For this we need to use Apply each step. Create the step and configure it as below.




Now we will be creating one more variable of type string which will hold comma separated string.




Now we are done creating flow. Now open any account record and try to update any attribute and check the flow result. 





You can use this string further as per your requirements.
Hope it helps...

 

Comments

Post a Comment

Popular posts from this blog

Read Only Sub Grid & Editable Sub grid in Dynamics 365

Understanding Sales Process in D365.

Understanding Business Unit in Dynamics 365.