cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Answer should save based on the question

Hi,

I have created a canvas and I have each question in each page. Same questions are in Excel too, In canvas the order of questions are not in same order as Excel

Based on the question the end user answer the answer should save in respective column next to the same question in excel.

QuestionsAnswers
AA 
BB 
CC 
DD 
23 REPLIES 23
eka24
Super User
Super User

Assuming your Excel Table3 had a Question number column or ID collumn, try the formula;

 

First( Filter( Table3, ID=Value( IDTextbox.Text) )), {Question: QuestionTextBox.Text,

Answer:AnswerTextbox.Text,

ID:IDTextbox.Text} )

 

Or

 

Patch(Table3,
First( Filter( Table3, ID= IDTextbox.Text) ), {Question: QuestionTextBox.Text,

Answer:AnswerTextbox.Text,

ID:IDTextbox.Text} )

 

You can change the ID Column to the Question number

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

mdevaney
Super User
Super User

@Anonymous 
Hello there,

I am making lots of guesses because you have not shared any details about your app.  Put this code in the OnSelect property of your save button for Question AA.

 

Patch(
    your_excel_table,
    LookUp(your_excel_table, Questions="AA"),
    {Answers = TextInput_AA.Text}
)

 

If this is not what you wanted to know please provide more details, especially what the completed spreadsheet should look like.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Anonymous
Not applicable

Thanks for your reply .

I will explain you my scenario, I have an excel, where it has a column_1 <Question> & column_2 <Results>.

There are 30 questions in the list. And out of 30, 10 has been already answered by end user and those 10 question are not in continuous series, kind of of random ex ( q.no 1, q.no 5, q no 7 ........).

I have created 20 sheets in canvas each page has 1 question.

My question are not in order but I want to store my results based on the question in the Canvas into excel.

I used <label> for question and I have dropdown_list for answers.

I need to store the answers based on the text inside the label.

Hope you got my requirement.

 

It is important your columns have I'd or questions numbers. 

Try

Patch(Table3,
First( Filter( Table3, ID= IDTextbox.Text) ), {Question: QuestionTextBox.Text,

Answer:Dropdown1.Selected.Value,

ID:IDTextbox.Text} )

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

Hi , I tried this but I am getting form formula error.

Patch(Table1,
First(Filter(Table1,SubCategoryNum =Label2.Text)),{'Sub Category':Label6.Text,
'Actual Maturity':Dropdown1.Selected.Value,
SubCategoryNum:Label2.Text})

Can you show a screenshot of your Table.

Also a screenshot of the error

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

Table pic_1Table pic_1Table pic_2Table pic_2Table pic_3Table pic_3CanvasCanvas

 

SubCategoryNum is my Id column, Sub Category is my question, Actual Maturity is where i need to store the answer.

 

Thanks but also show a screenshot of the error. So in edit mode of your app, take a screenshot of the formula which will indicate the error
Anonymous
Not applicable

image.pngimage.png

 

This are the pics of Formula and error details .

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,180)