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

Generate 'yes/no' from checkbox

Hello,

I am trying to generate 'yes/no' answers from two checkboxes and have it show up as 'yes/no' in my data source. I've tried following some other guides, but get stuck. This is probably very simple, but I haven't been able to figure it out.

Thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Akash17 ,

Just adding another option if you are using SubmitForm - I do exactly what you are doing (I do not use Boolean fields at all) - here is a section of my Delegation blog with the process.

View solution in original post

5 REPLIES 5
Akash17
Responsive Resident
Responsive Resident

Hi @TCM 

Your scenario is not much clear as you haven't attached anything but still in general scenario you can do following😊

You can patch your checkbox response into database using

Patch(Tablename,Defaults(Tablename),{Yesno:Checkbox1.Value}); note Yesno is my column name in database

and if you want to show this response in the form of Yes/No in gallery then on Text property of the Label you can set 

If(ThisItem.Yesno=true,"Yes","No")

Screenshot (626).png

WarrenBelz
Super User
Super User

Hi @Akash17 ,

Just adding another option if you are using SubmitForm - I do exactly what you are doing (I do not use Boolean fields at all) - here is a section of my Delegation blog with the process.

Akash17
Responsive Resident
Responsive Resident

Thank You @WarrenBelz 😊

TCM
Helper II
Helper II

Hello,

Here the image for my app. I've tried both solutions and the code is showing up as an error. I'm not sure where to put Patch(Tablename,Defaults(Tablename),{Yesno:Checkbox1.Value});. 

TCM_0-1659982587516.pngTCM_1-1659982690342.png

Thanks!

@TCM ,

The code is actually exactly what @Akash17 had for the label but in reverse - it is also in my blog

Patch(
   Tablename,
   Defaults(Tablename),
   {
      Yesno: If(Checkbox1.Value, Yes","No")
   }
)

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,882)