cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SGlass
New Member

Update Checkboxes based on Text Input value

Hello, I've been using PowerApps for about a year now, first time posting(I'm nervous). I work in a factory.
I'm getting braver at pushing the functionality to what I want powerapps to do.

I am currently trying to have checkboxes auto-select based on if a certain value is present in another box.
I included in my screenshot the screen I am currently working with. 
The top box (110T-100N) is a choice based on what the user selects. My list has 300 items to choose from but it is all different combinations of the ingredients below and the recipe is shown by the letters(I marked that as the Ref. in red). I would like to have the text box (highlighted yellow) auto-check the letters that are needed for the recipe based on the value present(underline in blue).

I currently have the OnCheck formula for each individual button as:
UpdateContext(({VAR_TI1_Def:ChemicalTreatment.Text &"A"}))

The yellow textbox has the formula name:

Default=(VAR_TI1_Def)

 

Which is letting me check the box, then it makes a letter appear in the yellow checkbox to show what the recipe chosen is. Basically, I want to work backward from that and I think I need an If() statement, but I'm not sure how to make it check a box if a value appears in the reference to what the recipe should be...

Ideas on some workaround or fix in my coding? Do I need to explain this differently?

5 REPLIES 5
dyee4614
Helper V
Helper V

Is this what you're trying to do...

 

You select "110T-100N".  This populates the reference number.  You want to make sure the check boxes which populate the yellow field matches that reference number.  Is that correct?  

 

If that is the case, I'd just do a lookup on the checkboxes so they will default to the correct option when the "110T is selected".  If you're trying to make sure they can't select certain fields, I'd set the displaymode property to a lookup so it will gray out inappropriate selections.  

 

Yes! That is exactly what I want to do!

I will try the lookup function and see if that works

Awesome.  I just did something similar so let me know if you need help w/ the code.

I need help with the code. I am not sure where to begin. 😥

The first step is probably setting up your lookup data.  I put in TRUE/FALSE.  You can enter in whatever you want.

 

ItemABCDEFG
T110-100NTRUEFALSEFALSETRUETRUETRUEFALSE

 

Here is how your app looks.

 

For each checkbox, you will write the following code corresponding to the column.

So Checkbox A(Apron) under default will say

If(lookup(DataSource, Item = dropdown1.selected.value,A) = "TRUE", true,false)

 

And you repeat that for all the checkboxes.  It's the same concept to disable options.  You would just put it under the display mode section and it would say "displaymode.disabled" or displaymode.edit

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,974)