cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
thjones
Level: Power Up

Creating a questionnaire with rules, and collecting responses and outputting them

Hi all,

 

I'm totally new to PowerApps,

 

Im creating a questionnaire type app, with rules to create logical flow. The idea behind this is that depending on an answer to a question a different subset of questions is asked.

 

I have the rules set out ok, depending on a drop down box selection will take you to a different screen, asking the next subset of questions.

 

My issue is this:

 

How do I collect and store the answers to these questions, without collecting and storing unanswered questions? And then either Email the answers to the person taking the questionnaire, or have them appear at the end of the questionnaire in a copy and pastable format?

 

As a side question, I would also like to append the question to the beginning of the response (i.e Question: Answer)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Creating a questionnaire with rules, and collecting responses and outputting them

Hi @thjones,

 

You could consider create a collection to hold the Questions answered temporarily.

For example, when the frist question is selected, the Next button or the navigate Button, add the following code:

Collect(AnsweredQuestions,{Question:QuestionName,Answer: Dropdown1.Selected.Value})

The code above would create a collection named 'AnsweredQuestions', with two column Question, Answer.

The QuestionName part could be set with the corresponding Label Text property.

Add this code under the OnSelect property of the control which would be triggered after the question has been answered.

 

If you would like to append the Question and the Answer in a string, then please take a try with the function below:

Concat(AnsweredQuestions, "Question:" & Question & "--Answer:"& Answer & Char(13) & Char(10))

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Community Support Team
Community Support Team

Re: Creating a questionnaire with rules, and collecting responses and outputting them

Hi @thjones,

 

You could consider create a collection to hold the Questions answered temporarily.

For example, when the frist question is selected, the Next button or the navigate Button, add the following code:

Collect(AnsweredQuestions,{Question:QuestionName,Answer: Dropdown1.Selected.Value})

The code above would create a collection named 'AnsweredQuestions', with two column Question, Answer.

The QuestionName part could be set with the corresponding Label Text property.

Add this code under the OnSelect property of the control which would be triggered after the question has been answered.

 

If you would like to append the Question and the Answer in a string, then please take a try with the function below:

Concat(AnsweredQuestions, "Question:" & Question & "--Answer:"& Answer & Char(13) & Char(10))

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thjones
Level: Power Up

Re: Creating a questionnaire with rules, and collecting responses and outputting them

Hey Michael,

 

Thanks for the response! I will give this a try this week!

 

Is there a way to caputure free text boxes in this way? Not every question is answered with a dropdown.

Anonymous
Not applicable

Re: Creating a questionnaire with rules, and collecting responses and outputting them

@v-micsh-msft Can you please answer the followup question about collecting free text/collecting a variety of response types.