cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

How do I get a count of values in a SharePoint item multi-select lookup column

Hi folks,

I have a SharePoint list which records details about payment requests. There is a lookup field which allows multiple values for Child Name, and there is a Total Amount field. I have a flow which gets the values of the multi-value lookup field and writes just the names to approval email (along with some other fields).

 

What I want to do now is get a count of those names so I can update the SharePoint list item column "Total Children" with that number, so that I can use that to divide the Total Amount by the Total Children.

 

I cannot figure out how to get that count.  Below is a screen shot of the current flow. I assume I need to initiate another integer variable, then use an Apply to Each to increment that variable, but I cannot figure out the process.

 

 

flow-shot.png

 

Can someone give me a clue how to add the extra bits to the flow to get that count?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How do I get a count of values in a SharePoint item multi-select lookup column

Hi @emjem ,

 

Since the value of the output of this field is an array, you could use length() function to get the number of array elements, and then determine Total Amount.

 

Suppose I have a lookup column named Child Name and support multiple selections. We can configure the Expression as shown below to get the count.

 

length(triggerBody()?['Child_x0020_Name'])

Image reference:

 

63.PNG62.PNG

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: How do I get a count of values in a SharePoint item multi-select lookup column

Hi @emjem ,

 

Since the value of the output of this field is an array, you could use length() function to get the number of array elements, and then determine Total Amount.

 

Suppose I have a lookup column named Child Name and support multiple selections. We can configure the Expression as shown below to get the count.

 

length(triggerBody()?['Child_x0020_Name'])

Image reference:

 

63.PNG62.PNG

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Regular Visitor

Re: How do I get a count of values in a SharePoint item multi-select lookup column

Is the solution mentioned below already solved?

 

I am having the same problem.

 

Thanks.

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,281)