Hi there,
I am creating and app that has an two option field in CDS (the two options are 0 or 1). By default, powerapps shows a dropdown box with the two options. I have figured out how to insert a toggle and i've checked out this answer about inserting 2 checkboxes
https://powerusers.microsoft.com/t5/Building-Power-Apps/How-do-I-make-a-Dropdown-a-checkbox-for-a-Tw... however i would like to just be able to insert one checkbox - if checked it writes back a 1 to the CDS, if unchecked it writes back a 0. Any ideas?
Cheers
Solved! Go to Solution.
Solved this myself - thought i'd share the solution:
Change the Checkbox Default to :
If(
ThisItem. 'YourEntityName'='YourEntityName (YourDataSourceName)'.'1',
ThisItem. 'YourEntityName'='YourEntityName (YourDataSourceName)'.'0',
false)
Note: if your options are numbers, they must be in single quotation marks.
Change the DataCard Update to:
If(CheckBoxName.Value,
'YourEntityName (YourDataSourceName)'.'1',
'YourEntityName (YourDataSourceName)'.'0')
Hi @Cym ,
I am not a CDS user, but the below should work.
If you are using SubmitForm on the Update property of the card
If (Checkbox.Value=true,1,0)
If Patch
OnCheck patch the CDS record with 1
OnUncheck, Patch the CDS record with 0
Please click and accept as Solution if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
Thanks for your help @WarrenBelz, but i can't seem to get that to work. Might need some more detailed explanation or different approach?
Thanks!
Hi @Cym ,
Just so I make sure I was not ambiguous on this (which is possible):-
If this is the case, I will leave it to others who will know CDS better.
Sorry I could not assist.
Thankyou, but i can't get it to work - CDS is weird!
Solved this myself - thought i'd share the solution:
Change the Checkbox Default to :
If(
ThisItem. 'YourEntityName'='YourEntityName (YourDataSourceName)'.'1',
ThisItem. 'YourEntityName'='YourEntityName (YourDataSourceName)'.'0',
false)
Note: if your options are numbers, they must be in single quotation marks.
Change the DataCard Update to:
If(CheckBoxName.Value,
'YourEntityName (YourDataSourceName)'.'1',
'YourEntityName (YourDataSourceName)'.'0')
User | Count |
---|---|
183 | |
105 | |
89 | |
45 | |
44 |
User | Count |
---|---|
226 | |
106 | |
106 | |
68 | |
67 |