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
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
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

Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,624)