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

Disabling a form item using a checkbox

Hi All 

In an attempt to resolve an issue I have I just need  few tips to perfect my solution.

 

When an item used on a form is ticked as disabled it must not show on the form drop down list .

 

What I have done is I have created a simple table  in SQL Azure  called Accident group : in that I have three  fields  an Id int , Name  (nvarchar) and the Disabled field as an integer which is either 0 or 1 . 0 = enabled ,1 means disabled 

 

In my form control where I maintain this record I have a checkbox in the same data card as the field Disabled I go and

 Update  the data-card with the formula: If(Checkbox1.Value=true,1,Checkbox1.Value=false,0) .

 

Once I have ticked the checkbox and saved the item it must update to 1 meaning it is now disabled  and on the form drop down it not available which works and what aim trying to achieve.

 

If unticked it must change the value back to 0 and the item must show on the drop down again .

 

This sort of works but is stoping from time to time .

 

  • First thing i see once i click the save button and go back to check i see the checkbox  control is unticked for my save I am using this formula:Set(GlobalApp,DataCardValue12.Text);SubmitForm('Edit_Accident group');If('Edit_Accident group'.ErrorKind.None=ErrorKind.None,Navigate('Administration_Accident group',ScreenTransition.None)) Iam supposed to add anything else for the checkbox to remain ticked ???

 

  • When I check the table after I have ticked the checkbox sometimes it does not update the 0 to a 1 and aim not sure why? .I have to click edit and edit button Iam just using a Navigate(Screen transtion.None)  formula , click re-save the record and try again .

 

  • On the capture form I do not have an issue on the drop down because once the record has  been updated to 1  ,I do not find it on the drop down and when  I go back and update it to 0 it becomes available again , but just to give the bigger picture aim using a Filter('[rp].[Accident group]',Disable=0)

Any tips on how I can perfect this in short if check box is ticked the disabled must become 1 meaning the item is disabled and must not show on the drop down and vice-versa when the check box is unticked disabled status = 0 and the record must show on the drop down .

My Sql table.PNG

 

My maintenance screen.PNG

My add the record and disable screen.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Re: Disabling a form item using a checkbox

Hi,

 

Regarding the checkbox not staying ticked, try to make a condition for your Default property of the checkbox depending on the results from the dataset on that save button.

 

Can you simplify the formula for inserting the 0 and 1 for the Disabled column and take it from there?

 

Thank you.

Ovidiu

View solution in original post

1 REPLY 1
Microsoft
Microsoft

Re: Disabling a form item using a checkbox

Hi,

 

Regarding the checkbox not staying ticked, try to make a condition for your Default property of the checkbox depending on the results from the dataset on that save button.

 

Can you simplify the formula for inserting the 0 and 1 for the Disabled column and take it from there?

 

Thank you.

Ovidiu

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (7,822)