Creating an array using list of records in Microsoft Flow.
Hello Guys,
Today we are going to learn how to create an array using a list of records in Microsoft Flow. If you are new to MS Flow then please read my this blog.
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.
As being a Software Developer, we all are aware of an array as we all have implemented in various programming languages like C#, Java, Python etc. Basically an array is nothing but the collection of similar data or complex data. We will be see how we can create these both type of an array.
Navigate to https://us.flow.microsoft.com and select your environment.
Click on Create and select Instant Flow. Configure it as below and click on create.
Now add a new step and initialize one variable as shown below.
As you can see in above image we have initialized Single Dimension Array. Save the changes and click on test the flow. You will see below output.
Now add a new step and initialize one more variable as below.
As you can see in above example we have initialized 2D array. Save the changes and test the flow. You will see below output.
While working with real time example we come across some scenario where we need to create collection of data. In this scenario we can create 2D array for storing our collection. For example consider we have Employee entity in CRM which is having some amount of data and we need to create a collection which can store this data so that we can use it for further process. To achieve this we will be creating one more variable of type array as below.
Now we will be retrieving Employee data from the CDS. Add a new step. Search List records and configure it as below.
Add a new step and search Select data operation and configure it as below.
For City,item()?['_idb_cityid_value@OData.Community.Display.V1.FormattedValue']
For Department,item()?['_idb_departmentid_value@OData.Community.Display.V1.FormattedValue']
So first of all we will understand the Select Data Operation. Basically Select Data operation is used for shaping the object into an array. It helps you to work with complex JSON and to select node from that JSON.
Add a new step and search set variable and configure it as below.
Save the changes and run the flow. You will see below output where our employee array contains data.
Great
ReplyDeleteThanks Ruksar...
Delete