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

How to make checkbox determine datacard used in control?

I am trying to use the same editform and same column in my SQL database, but have the control provide a different option for the user depending on a checkbox selection.

 

On one hand, if the checkbox is selected I want the control to show a free-form text box for entry.

Ginko_0-1652827527786.png

 

On the other hand, if the checkbox is blank, use a dropdown list of available selections.

Ginko_1-1652827606064.png

 

The issue is that this is just a visibility switch and the form is still going to save the last edited card. This is especially problematic for existing database entries that see adjustment. If a value is already present or gets fat-fingered in and not removed before submission and there are selections/text in both entries spaces, the form struggles to know which entry to retain.

 

Does anyone know how to essentially switch off one card or the other, depending on what is visible or set otherwise so that only the expected of the two cards saves/updates on the database? I've tried having two separate controls but its the same outcome.

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Ginko ,

The Visible would simply be (Text Box)

YourCheckBoxName.Value

and (Drop-Down)

!YourCheckBoxName.Value

The Update of your Data Card

If(
   YourCheckBoxName.Value,
   YourTextBoxName,Text,
   YourDropdownName.Selected.Value
)

this is assuming your drop-down is a Choice column or hard-coded.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

 

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @Ginko ,

The Visible would simply be (Text Box)

YourCheckBoxName.Value

and (Drop-Down)

!YourCheckBoxName.Value

The Update of your Data Card

If(
   YourCheckBoxName.Value,
   YourTextBoxName,Text,
   YourDropdownName.Selected.Value
)

this is assuming your drop-down is a Choice column or hard-coded.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

 

Ginko
Helper III
Helper III

Warren that is perfect, thank you! It didn't dawn on my to treat the Update field with an If statement, that's so helpful for a number of my controls, you rock!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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