Need some help creating a dynamic form with multiple flows

Copper Contributor

Hi all,

 

I run a Welfare Centre where we have several forms, I would like to create one form for different flows using branching. Then use several flows to do different things

 

Form, they select from the following:

 

1. Request a pass - leads to gym,car,hall pass - they selected and it emails them the pass

2. Submit a question - leads to selecting a department - then it emailed to that department

3. submit a complaint - then they type the complaint-then it is emailed to a person

 

 

I am happy with the emailing information bit. I just have not got a clue how to do the email attachment. Can anyone advise please

 

3 Replies

@Mick_gibbons1 you don't need multiple flows, you can do this with a single flow.

 

The first question in the form would be a choice "What do you want to do?" with the answers Request a pass, Submit a question and Submit a complaint. You'd then use branching to appropriate follow-on sections/questions depending on what answer is selected.

 

In your flow you'd start with the "when a new response is submitted" trigger and "get response details" as the first action.

 

The next action would be a Switch control which is a type of condition that just looks at what the answer to the "what do you want to do" question equals. You can have up to 27 "cases" for each switch: in case the answer equals Request a pass then you add those actions. In case it equals Submit a question then you add those actions in and so on. An example of a switch based on the department is shown below:

1-Switch.png

 

So if the user had selected submit a question you could have a condition (or another switch nested inside the first one) that has a send an email action that sends it to the department selected.

 

Email the pass. Make sure you are inside the case channel for request a pass. My example is for a workshop survey and the first couple of actions get the date the service took place and convert that date to UK format (for correct format in the PDF). I'm adding a logo into the email and PDF so the next action is to get that image:

1-Flow.png

 

Next you need to create an html file with the details to go into the pass. So add a OneDrive for Business Create file action. Because I have added the logo in I have clicked the </> code view button at the top of the file content field and then added html tags. For the filename make sure you add the .html extension.

 

2-Flow.png

 

Next, convert the html file to a PDF:

 

3-Flow.png

 

 

Next, create the PDF (if you want to keep a copy of it on your OneDrive, otherwise you can omit this step)

 

4-Flow.png

 

Finally, add a send an email action and for the attachment select File name and File content from the convert file using path section of the dynamic content box.

5-Flow.png

 When the form is submitted, it sends theemail with the PDF attached.

6-Email.png

 

7-PDF.png

 

 

So you could use this as the basis for sending a pass to the person with the details they submitted. Don't forget, all the actions above are in the Request a pass channel of the switch case. You would add other actions into the other case channels for the other 2 cases.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott 

 

sorry, i did not get a message saying you have replied. i will work through this today, thank you so much

@RobElliott I wonder if you can help me, please

 

So I have built all 5 cases from the initial question. I have not done the attached files yet but I have done the Send email v2 which are all working great. However

 

Case 2, the question is Submit a question to a department. Then a list of 7 departments. I would like it to email a different department depending on their selection.

 

I have case 2 equals Submit a questions or suggestion to a department.

I have tried adding switches and controls to then branch off and have separate emails sent but they are not working.

 

I know I could just add seven more cases under the initial switch. But is there a way I can have theses sitting under case 2 instead?