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

select 2 checkbox problem

Hello guys I'm trying to do a page using checkbox more then 2...but now I'm trying with 2 checkbox and text

but when I'm selected 2 box only 1 data go save in excel table....how do I want to make 2 data save in excel 1 row...

If success i'll proceed with more then 2 checkbox..

Here the screenshot and the code I used:

1.PNG2.PNG

 

 

Any solution for this problem? Hopefully I can get hep ASAP

 

Rgd

Azzam

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Participant
Power Participant

Re: select 2 checkbox problem

Good morning!

 

You do two calls to Patch, so naturally you get two records in the database. If you want only one record, you have to make only one call to Patch!

 

Patch(Table1_1, Defaults(Table1_1), {NAME:User().FullName,RESULT1:Checkbox1.Text, RESULT2.Checkbox2.Text})

What you also might want to do is to check if a checkbox have been clicked, so you have to add an If-statement:

 

 

Patch(Table1_1, Defaults(Table1_1), {NAME:User().FullName, If(Checkbox1.Value, RESULT1:Checkbox1.Text), If(Checkbox2.Value, RESULT2.Checkbox2.Text)})

Lastly, you might want to store the current user in a variable at app start, using either Set or UpdateContext, so you don't have to do the time consuming call to User() every time.

 

Good luck!

 

 

View solution in original post

2 REPLIES 2
Highlighted
Power Participant
Power Participant

Re: select 2 checkbox problem

Good morning!

 

You do two calls to Patch, so naturally you get two records in the database. If you want only one record, you have to make only one call to Patch!

 

Patch(Table1_1, Defaults(Table1_1), {NAME:User().FullName,RESULT1:Checkbox1.Text, RESULT2.Checkbox2.Text})

What you also might want to do is to check if a checkbox have been clicked, so you have to add an If-statement:

 

 

Patch(Table1_1, Defaults(Table1_1), {NAME:User().FullName, If(Checkbox1.Value, RESULT1:Checkbox1.Text), If(Checkbox2.Value, RESULT2.Checkbox2.Text)})

Lastly, you might want to store the current user in a variable at app start, using either Set or UpdateContext, so you don't have to do the time consuming call to User() every time.

 

Good luck!

 

 

View solution in original post

Highlighted
Helper III
Helper III

Re: select 2 checkbox problem

Thank you for your solutions...kindly apperciate it.. @BitLord69

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 (7,696)