cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Convert Microsoft Forms Array to Bullets

Hello,

 

I’m using the “Send an Outlook email for each Microsoft Forms survey response” Flow template and I would like to convert the arrays sent in the form to bullets (unordered list). 

 

flow.jpg

 

For example, the form contents currently come through like this:

 

Name: ["Bill","Robert","Paul"]

 

And I’d like to convert to this:

 

  • Bill
  • Robert
  • Paul

 

Following a few examples on the Internet, I figured I’d take the following approach:

 

  1. Wrap the entire field name with <ul></ul> in my email source code (placing the output in-between)
  2. Next I would use string replacement to swap the brackets [] with <li>’s and remove the double quotes using the 3 Compose functions below:

 

The expression in Compose is: replace(body('When_a_new_response_is_submitted')?['r6944a0257ae344fc8c35bd2a7cf1363e'],'["','<li>')
The expression in Compose 2 is: replace(outputs('Compose'),'"]','</li>')
The expression in Compose 3 is: replace(outputs('Compose_2'),'","','</li><li>')

 

My first issue is I keep getting the error below (in two different browsers and clearing cache).

 

The template validation failed: 'The action(s) 'When_a_new_response_is_submitted' referenced by 'inputs' in action 'Compose' are not defined in the template.'.

 

My second question is, it this the best way to go about this?  Is there a built-in method or more efficient method of doing this?  Also, since I can’t get past the initial error, I’m not sure whether what I have will actually work so any thought/feedback anyone can provide would be helpful.

 

Thanks

5 REPLIES 5
Highlighted
Super User II
Super User II

Re: Convert Microsoft Forms Array to Bullets

@flow2_usa 

Hi there.  I think there needs to be a step immediately after your trigger to get the forms responses.  I don't think the data from the form is included in the trigger (or have you verified that, already?)

 

Check that and keep us posted.

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Highlighted
New Member

Re: Convert Microsoft Forms Array to Bullets

Apologies, this is only my second day using Flow (and forms for that matter).  

 

The only thing in the flow is the MS Form followed by the 3 Compose sections and the final Send Email.  If I remove the 3 Compose steps - the email is sent without error.

 

So how so I get the form's responses for the Compose actions to execute?

Highlighted
Super User II
Super User II

Re: Convert Microsoft Forms Array to Bullets

Ah, ok.  No worries at all, it helps to know where you're coming from.

 

So, any time you use a Forms trigger, all that is doing is saying "Someone submitted a Form".  All of the stuff on the Form doesn't come along for the ride on the Trigger (which is weird, since most of the other Triggers do this).

 

Because of this, you'll want to add an action after any Forms trigger called "Get Response Details".  This is going to kick off an "Apply to Each" loop, but don't freak out.  I think Flow is presuming that you're grabbing multiple responses and it wants to get them all.  Just keep doing things inside of the loop and then send the email after the loop.

 

So, inside of the loop, put in your compose stuff, but now you should see the fields from the Forms and can put those in your Replace functions.  The "Send an Email" part should happen outside of the loop but I don't know if the Compose stuff will carry over.  If not, we can set variables and do the same kind of thing.  I just did a video with something similar:

 

I'll start messing around with the formatting (adding bullets) in case yours doesn't work, but that should get you pretty close.  Keep us posted.

 

-Ed-

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Highlighted
New Member

Re: Convert Microsoft Forms Array to Bullets

Maybe I'm not adding the forLoop correctly but I can now save the Flow but it generates an error on runtime.  This is what's in the first Compose:

replace(body('Get_response_details')?['r17cd7d2edd324bc2a844bbe8fa02eed7'],'["','<li>')
 
flow2.jpg
Highlighted
New Member

Re: Convert Microsoft Forms Array to Bullets

@flow2_usa 

 

Was this ever resolved? I have the same need. I've got a form field, "Agenda Items", that is submitted by a user (sometimes with bullet points, sometimes not), but I want the list to remain intact when my Flow sends me an email with the info after the from is completed. However, it continually puts the list into a sentence.

 

I watched the video that @edgonzales posted, but he only references approval flows, which I don't think apply to me.

 

Any and all help is greatly appreciated. 

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

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

thirdimage

Power Automate Community User Group Member Badge

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

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