cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Radio button and selection box

Good night,
I have a form where I need to save the selection of boxes, radio button for each record. At the time of selecting a record in Gallery it has the boxes selected at the time it was created.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Radio button and selection box

Hi @CarlosN ,

Do you want to save the selections of checkboxes and Radio buttons back to your data source?

 

Based on the needs that you mentioned, I afraid that the SubmitForm function could not achieve your needs. Instead, please consider use Patch function to submit your form data.

 

In order to save the selections of checkboxes and Radio buttons back to your data source for each record, you need to create corresponding columns in your data source to store these selections.

For the two radio buttons in your form, please create two individual Text columns in your SP List to store the Radio button selection. Then set the Default property of the two Radio buttons to following formula separately:

 

Gallery1.Selected.RadioColumn1
Gallery1.Selected.RadioColumn2

 

 

For these Checkbox controls in your Form, you could consider group them into three categories. First Category (MODIF & ENSAYO), Second Category (ESTILO ~ IMPRESION), Third Category (Cotizacion ~ Ficha Tecnica). And within your data source, you need to create one individual Text type column for each Category to store the checkbox selections. e.g. For Category1 (MODIF & ENSAYO), if you want to collect the selections, please use the following formula:

 

Concatenate(
            If(
               MODIF_Checkbox.Value = true,
               "MODIF;",
               Blank()
            ),
            If(
                ENSAYO_Checkbox.Value = true,
                "ENSAYO;",
                Blank()
            )
)

 

Set the Default property of the MODIF Checkbox to following:

 

If(
   "MODIF" in Gallery1.Selected.Category1,
   true,
   false
)

 

Set the Default property of the ENSAYO Checkbox to following:

 

If(
   "ENSAYO" in Gallery1.Selected.Category1,
   true,
   false
)

 

similar logic should be applied to the rest of two Categories.

 

 

You should use the following Patch formula to patch form data back to your SP List:

 

Patch(
      'Your Data Source',
      Defaults('Your Data Source'),
      {
         RadioColumn1: Radio1.Selected.Value,
         RadioColumn2: Radio2.Selected.Value,
         Category1: Concatenate(
                                 If(
                                     MODIF_Checkbox.Value = true,
                                     "MODIF;",
                                     Blank()
                                  ),
                                  If(
                                     ENSAYO_Checkbox.Value = true,
                                     "ENSAYO;",
                                     Blank()
                                  )
                       ),
          Category2: Concatenate(
                                 If(
                                     ESTILO_Checkbox.Value = true,
                                     "ESTILO;",
                                     Blank()
                                  ),
                                  If(
                                     PEGUE_Checkbox.Value = true,
                                     "PEGUE;",
                                     Blank()
                                  ),
                                  ...
                                  ...,
                                  If(
                                     IMPRESION_Checkbox.Value = true,
                                     "IMPRESION;",
                                     Blank()
                                  )
                       ),
           Category3: Concatenate(
                                 If(
                                     Cotizacion_Checkbox.Value = true,
                                     "Cotizacion;",
                                     Blank()
                                  ),
                                  If(
                                     Muestra_Checkbox.Value = true,
                                     "Muestra;",
                                     Blank()
                                  ),
                                   If(
                                     FichaTecnica_Checkbox.Value = true,
                                     "Ficha Tecnica;",
                                     Blank()
                                  )
                       )
      }
)

 

Note: The Category column name, Radio column name is dependent on your needs, you could customize it as your needs.

Please consider take a try with above solution, check if the issue is solved.

 

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.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Radio button and selection box

Hi @CarlosN ,

Do you want to save the selections of checkboxes and Radio buttons back to your data source?

 

Based on the needs that you mentioned, I afraid that the SubmitForm function could not achieve your needs. Instead, please consider use Patch function to submit your form data.

 

In order to save the selections of checkboxes and Radio buttons back to your data source for each record, you need to create corresponding columns in your data source to store these selections.

For the two radio buttons in your form, please create two individual Text columns in your SP List to store the Radio button selection. Then set the Default property of the two Radio buttons to following formula separately:

 

Gallery1.Selected.RadioColumn1
Gallery1.Selected.RadioColumn2

 

 

For these Checkbox controls in your Form, you could consider group them into three categories. First Category (MODIF & ENSAYO), Second Category (ESTILO ~ IMPRESION), Third Category (Cotizacion ~ Ficha Tecnica). And within your data source, you need to create one individual Text type column for each Category to store the checkbox selections. e.g. For Category1 (MODIF & ENSAYO), if you want to collect the selections, please use the following formula:

 

Concatenate(
            If(
               MODIF_Checkbox.Value = true,
               "MODIF;",
               Blank()
            ),
            If(
                ENSAYO_Checkbox.Value = true,
                "ENSAYO;",
                Blank()
            )
)

 

Set the Default property of the MODIF Checkbox to following:

 

If(
   "MODIF" in Gallery1.Selected.Category1,
   true,
   false
)

 

Set the Default property of the ENSAYO Checkbox to following:

 

If(
   "ENSAYO" in Gallery1.Selected.Category1,
   true,
   false
)

 

similar logic should be applied to the rest of two Categories.

 

 

You should use the following Patch formula to patch form data back to your SP List:

 

Patch(
      'Your Data Source',
      Defaults('Your Data Source'),
      {
         RadioColumn1: Radio1.Selected.Value,
         RadioColumn2: Radio2.Selected.Value,
         Category1: Concatenate(
                                 If(
                                     MODIF_Checkbox.Value = true,
                                     "MODIF;",
                                     Blank()
                                  ),
                                  If(
                                     ENSAYO_Checkbox.Value = true,
                                     "ENSAYO;",
                                     Blank()
                                  )
                       ),
          Category2: Concatenate(
                                 If(
                                     ESTILO_Checkbox.Value = true,
                                     "ESTILO;",
                                     Blank()
                                  ),
                                  If(
                                     PEGUE_Checkbox.Value = true,
                                     "PEGUE;",
                                     Blank()
                                  ),
                                  ...
                                  ...,
                                  If(
                                     IMPRESION_Checkbox.Value = true,
                                     "IMPRESION;",
                                     Blank()
                                  )
                       ),
           Category3: Concatenate(
                                 If(
                                     Cotizacion_Checkbox.Value = true,
                                     "Cotizacion;",
                                     Blank()
                                  ),
                                  If(
                                     Muestra_Checkbox.Value = true,
                                     "Muestra;",
                                     Blank()
                                  ),
                                   If(
                                     FichaTecnica_Checkbox.Value = true,
                                     "Ficha Tecnica;",
                                     Blank()
                                  )
                       )
      }
)

 

Note: The Category column name, Radio column name is dependent on your needs, you could customize it as your needs.

Please consider take a try with above solution, check if the issue is solved.

 

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.

View solution in original post

Highlighted
Helper II
Helper II

Re: Radio button and selection box

Thanks,

Excellent answer.

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,215)