cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
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
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
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors
Users online (5,842)