cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emjem
Level: Powered On

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 Team
Community Support Team

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

1 REPLY 1
Highlighted
Community Support Team
Community Support Team

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 436 members 6,102 guests
Please welcome our newest community members: