Array functions in Microsoft Flow.

 Hello Guys,

In our previous blogs we have seen how to create an array in MS Flow and how to filter an array based on some criteria. Today we are going to learn some functions which are used while working with an array. 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.

We will be working with same flow which we have created in previous blog.

1. length():  This function return total number of items available in array collection.
Syntax : length(Array Collection)


















length(variables('Employee Array'))




2. empty(): This function is used to check whether array collection is empty or not. It will return true or false.
Syntax : empty(Array Collection)




length(variables('Employee Array'))

3. first(): This function is used to retrieve first element of the array.
Syntax : first(Array Collection)




















first(variables('Employee Array'))

4. last(): This function is used to retrieve last element of the array.
Syntax : last(Array Collection)



last(variables('Employee Array'))
5. take(): This function is similar to the top statement of SQL which returns top elements of the array.
Syntax : take(Array Collection , Count)


















take(variables('Employee Array'),4)

6. skip(): This function removes items from the front of a collection, and return all the other items.
Syntax : skip(Array Collection , Count of skip)


















skip(variables('Employee Array'),4)

7. intersection():  It returns a collection that has only the common items across the specified collections.
Syntax : intersection(Array Collection1 , Array Collection2)



















intersection(outputs('Take'),outputs('Skip'))

8. union():  It Returns a collection that has all the items from the specified collections. It returns distinct collection removing duplicate values.
Syntax : union(Array Collection, Array Collection)




















union(variables('Element'),variables('Element'))

9. join():  It returns a string that has all the items from an array, separated by the specified character. In other words it join all the elements of the array using specified delimiter.
Syntax : join(Array Collection, delimiter)



















join(variables('Element'),'-')

10. contains():  It checks whether a collection has a specific item or not. It returns true or false.
Syntax : contains(Array Collection, value to check)



















contains(variables('Element'),67)

Hope it helps...
















Comments

Popular posts from this blog

Read Only Sub Grid & Editable Sub grid in Dynamics 365

Using Pipelines in Power platform for deploying solutions to environments.

Understanding Sales Process in D365.