cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mykbitz
Frequent Visitor

Edit/Update Radio Buttons

Hello Power Users,

I am developing an app similar to a quiz/survey, however, in this instance, a user can record multiple sessions (each session is saved as a record/row with multiple questions/responses - columns). Am running out of ideas on how a user can edit/update previously recorded radio button options. Any suggestions/examples on how a user can pull up a record from a collection to update/edit a given question in a record entry? All records are saved to a collection prior to committing to a SQL database. Thanks

ExampleExample

1 ACCEPTED SOLUTION

Accepted Solutions
PavanKumar
Responsive Resident
Responsive Resident

Hi,

For every session while collecting the values into collection add two more columns Session Name (Session1,2,3 etc)- Session Start Time (Date time of session start).

 

Place a dropdown on top left of the form. Binding the collection and display session Names. e.g. Drop down shows Session1, session2, session3 etc.

 

Selected session related row should be saved in another collection (which ideally has one active row information)

 

The active row information should be bound to all radiobuttons.

 

When user updates session related dropdowns it updates back only to particular row, particular column.

 

Please feel free to let me know if that answers your questions.

 

 

If it answers do mark it as verified.

Regards,

Pavan Kumar Garlapati

View solution in original post

2 REPLIES 2
PavanKumar
Responsive Resident
Responsive Resident

Hi,

For every session while collecting the values into collection add two more columns Session Name (Session1,2,3 etc)- Session Start Time (Date time of session start).

 

Place a dropdown on top left of the form. Binding the collection and display session Names. e.g. Drop down shows Session1, session2, session3 etc.

 

Selected session related row should be saved in another collection (which ideally has one active row information)

 

The active row information should be bound to all radiobuttons.

 

When user updates session related dropdowns it updates back only to particular row, particular column.

 

Please feel free to let me know if that answers your questions.

 

 

If it answers do mark it as verified.

Regards,

Pavan Kumar Garlapati

v-xida-msft
Community Support
Community Support

Hi @mykbitz ,

Could you please share a bit more about the data structure of your SQL Table/Collection?

Do you create a question column in your SQL Table/Collection for each question in your quiz/survey app?

Further, how do you save data into your collection? Using Patch function? Could you please share more details about the formula?

 

I assume that there is a column (SectionColumn) in your collection, which is used to store the Section value (Part A, Part B, Parat C, ...). I have made a test on my side, please take a try with the following workaround:

Within your previous question screen, set the OnSelect proeprty of the "NEXT" button to following:

If(
     !IsBlank(LookUp(RecordsCollection, SectionColumn = "Current Section Value")),    /* <-- "Current Section Value" -> Part A, Part B, Part C, ...*/
      Patch(                                               /* <-- Add new record into your collection */
                 RecordsCollection,
                 Defaults(RecordsCollection),
                 {
                     QuestionColumn1: AnswerRadio1.Selected.Value,
                     QuestionColumn2: AnswerRadio2.Selected.Value,
                     ...
                 }
      ),
      Patch(                                                           /* <-- Edit existing record in your Collection */
                 RecordsCollection,
                 LookUp(RecordsCollection, SectionColumn = "Current Section Value"),
                 {
                     QuestionColumn1: AnswerRadio1.Selected.Value,
                     QuestionColumn2: AnswerRadio2.Selected.Value,
                     ...
                 }
      )
)

Note: I assume that you save the section record into your collection when you click the "NEXT" button.

 

More deetails about Patch function, please check the following article:

Patch function

 

Best regards,

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

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 (2,677)