cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Auto populate from checkbox value

Happy Thursday!

 

I have a request from a user.  Is it possible when they check "Team member" it auto hidden both "EHR" & "EHR Account Number", at the same time It auto populate a value from the drop down  example - "eCW"  and also add a 0 to the EHR Account Number. Since both are a required field. Capture.PNG

 

Let me know if i explain myself clearly 

 

Thank you so much in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Auto populate from checkbox value

@oappdev 

Maybe you could do something like this...

 

Put this code in the Visible property of both EHR and EHR Account Number.  It will show the fields when the checkbox is not checked. 

 

!chk_TeamMember.Value

 

Then use this code in the OnChange property of the checkbox

 

Set(resetDefaults, true); Set(resetDefaults, false);

 

Next put this code in the Reset property of both the EHR and AccountNumber controls

 

resetDefaults

 

Make the DefaultSelectedItems property for EHR this code.

 

If(chk_TeamMember.Value, ["eCW"], some_other_value)

 

And make the Default property for Account Number this code.

 

If(chk_TeamMember.Value, 0, some_other_value)

 

---
Please click "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."

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Re: Auto populate from checkbox value

@oappdev 

Maybe you could do something like this...

 

Put this code in the Visible property of both EHR and EHR Account Number.  It will show the fields when the checkbox is not checked. 

 

!chk_TeamMember.Value

 

Then use this code in the OnChange property of the checkbox

 

Set(resetDefaults, true); Set(resetDefaults, false);

 

Next put this code in the Reset property of both the EHR and AccountNumber controls

 

resetDefaults

 

Make the DefaultSelectedItems property for EHR this code.

 

If(chk_TeamMember.Value, ["eCW"], some_other_value)

 

And make the Default property for Account Number this code.

 

If(chk_TeamMember.Value, 0, some_other_value)

 

---
Please click "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."

View solution in original post

Highlighted
Post Patron
Post Patron

Re: Auto populate from checkbox value

Thank you @mdevaney Will give it shoot and let me know 😎

Highlighted
Post Patron
Post Patron

Re: Auto populate from checkbox value

@mdevaney 

 

I don't see OnChange property of the checkbox

 

Capture1.PNG

Highlighted
Super User III
Super User III

Re: Auto populate from checkbox value

@oappdev
You are right!

Put the “OnChange” code in both the OnCheck and OnUncheck properties.
Highlighted
Post Patron
Post Patron

Re: Auto populate from checkbox value

Thank you @mdevaney Got it working 😎

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,405)