cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rob_CTL
Helper V
Helper V

Counting the number of values within a Form multiple answers box

Hi,


I have a MS Form that has a multiple answers box like the one below:

 

flow-1.png

 

What I'd like to do is could the number of answers that is submitted and output the result as a numeric value I can use later within the flow.  I can see that within Flow the values are separated out and I thought I could use length to calculate but that doesn't appear to be working.

 

flow-2.png

 

Any thoughts gratefully received.

 

Cheers

Rob

1 ACCEPTED SOLUTION

Accepted Solutions

@manuelstgomes I think I've got a solution, it's not pretty but it works.

 

- I split the string using the comma as a delimiter

 

flow-10.png

 

- I then use this output and initialise a variable to create an array

 

Flow-11.png

 

- Finally I use a length expression to count the number of items in the array

 

Flow-12.png

 

The resulting output from this I can then fire into a SharePoint column

 

Flow-13.png

 

If anyone has a more elegant solution it be great to see it.

 

Cheers
Rob

 

View solution in original post

5 REPLIES 5
manuelstgomes
Super User
Super User

Hi @Rob_CTL 

 

Getting information from Forms is tricky because everything comes in string format. I provide more details in how to take care of these issues in this article I wrote.

https://manueltgomes.com/microsoft/forms/format-submitted-data/

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Hi @manuelstgomes 

 

Thanks for the link.

 

I can see that the output is formatted in both JSON and a string

 

flow-3.png

 

I am thinking there must be a way I can manipulate this data into something that I can count, or maybe I am wishing to much 🙂

 

Cheers
Rob

Hi @Rob_CTL 

 

Try the parse JSON action..

 

But the issue is that everything is a string in Forms. It sucks I know but we need to deal with that 🙂

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

@manuelstgomes I think I've got a solution, it's not pretty but it works.

 

- I split the string using the comma as a delimiter

 

flow-10.png

 

- I then use this output and initialise a variable to create an array

 

Flow-11.png

 

- Finally I use a length expression to count the number of items in the array

 

Flow-12.png

 

The resulting output from this I can then fire into a SharePoint column

 

Flow-13.png

 

If anyone has a more elegant solution it be great to see it.

 

Cheers
Rob

 

Hi @Rob_CTL 

 

BINGO!!! You did it! That's it. Well done!

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,290)