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

Need some help on Powerapps with sharepoint list

Hello, i need a little help on powerapps.

 

I need to make an app that is based on some sharepoint list. The app is supposed to get a question, take the specific 4 answer of this question and then store the selected answer in an other sharepoint list.

 

So i got a question sharepoint list,  i have another sharepoint list with 4 answer per question so i got a lookup assigned to the question it refers to. And i need to store only the selected answer by the user in a third sharepoint list.

And i have 2 majors problem i'm a power apps begginner and i don't know how to make the choice between the 4 answer (i can not use the "choice" field of sharepoint) so every answer is an item of a sharepoint list linked to the question by a lookup column.

And secondly i don't know how to store the selected item in another list with powerapps.

If anyone got a solution i'm pretty sure its not that hard but i tried by myself and i failed so if anyone got an idea 🙂

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you mean that :

1) question sharepoint list: one question field (text type)

2)answer list:  four answer field(text type), related question field(lookup field)

choose answer for every question and save the selected item to another list (selected answer list)?

If so, I've made a similar test for your reference:

1)create three lists

question list: question field(text type)

answer list: related question field(lookup field) A1,A2,A3,A4fields(text type)

selectedanswer list: question field(lookup field--to question list), answer field(text type)

2)in powerapps

insert a gallery, set its Items: Answer

insert a label and four check boxes inside the gallery

set the label's Text:

ThisItem.relatedquestion.Value

set checkbox1's Text:

ThisItem.A1

set checkbox1's OnCheck:

Set(var,A1);Reset(Checkbox2);Reset(Checkbox3);Reset(Checkbox4)

set checkbox2's Text:

 

ThisItem.A2

 

set checkbox2's OnCheck:

 

Set(var,A2);Reset(Checkbox1);Reset(Checkbox3);Reset(Checkbox4)

 

set checkbox3's Text:

 

ThisItem.A3

 

set checkbo31's OnCheck:

 

Set(var,A3);Reset(Checkbox1);Reset(Checkbox2);Reset(Checkbox4)

 

set checkbox4's Text:

 

ThisItem.A4

 

set checkbox4's OnCheck:

 

Set(var,A4);Reset(Checkbox1);Reset(Checkbox2);Reset(Checkbox3)

 

set the arrow button's OnSelect:

If(IsEmpty(Filter(selectedanswer,question.Value=ThisItem.relatedquestion.Value)),Patch(selectedanswer,Defaults(selectedanswer),{question:ThisItem.relatedquestion,answer:var}),Patch(selectedanswer,LookUp(selectedanswer,question.Value=ThisItem.relatedquestion.Value),{answer:var}))

1231.PNG

 

1232.PNG

 

1233.PNG

 

1234.PNG

 

Then after you choose answer click the arrow button.If the question has answer already, you will update answer.If the question has no answer, you will create answer.

 

 

Best regards,

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

View solution in original post

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you mean that :

1) question sharepoint list: one question field (text type)

2)answer list:  four answer field(text type), related question field(lookup field)

choose answer for every question and save the selected item to another list (selected answer list)?

If so, I've made a similar test for your reference:

1)create three lists

question list: question field(text type)

answer list: related question field(lookup field) A1,A2,A3,A4fields(text type)

selectedanswer list: question field(lookup field--to question list), answer field(text type)

2)in powerapps

insert a gallery, set its Items: Answer

insert a label and four check boxes inside the gallery

set the label's Text:

ThisItem.relatedquestion.Value

set checkbox1's Text:

ThisItem.A1

set checkbox1's OnCheck:

Set(var,A1);Reset(Checkbox2);Reset(Checkbox3);Reset(Checkbox4)

set checkbox2's Text:

 

ThisItem.A2

 

set checkbox2's OnCheck:

 

Set(var,A2);Reset(Checkbox1);Reset(Checkbox3);Reset(Checkbox4)

 

set checkbox3's Text:

 

ThisItem.A3

 

set checkbo31's OnCheck:

 

Set(var,A3);Reset(Checkbox1);Reset(Checkbox2);Reset(Checkbox4)

 

set checkbox4's Text:

 

ThisItem.A4

 

set checkbox4's OnCheck:

 

Set(var,A4);Reset(Checkbox1);Reset(Checkbox2);Reset(Checkbox3)

 

set the arrow button's OnSelect:

If(IsEmpty(Filter(selectedanswer,question.Value=ThisItem.relatedquestion.Value)),Patch(selectedanswer,Defaults(selectedanswer),{question:ThisItem.relatedquestion,answer:var}),Patch(selectedanswer,LookUp(selectedanswer,question.Value=ThisItem.relatedquestion.Value),{answer:var}))

1231.PNG

 

1232.PNG

 

1233.PNG

 

1234.PNG

 

Then after you choose answer click the arrow button.If the question has answer already, you will update answer.If the question has no answer, you will create answer.

 

 

Best regards,

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

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (20,418)