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

Combobox OnChange (Edit form) needs to reset fields with a default/ThisItem value

I have a combobox that has an OnChange value that auto-populates a text box and filters the item list for a second combobox. This works great on my New form. However, the same function the New form aren't working as desired for the Edit form.

New Form
Site Name (ComboBox1)

  • OnChange:UpdateContext({varSite:LookUp('CompanySiteDepartment',ComboBox1.Selected.Result = SiteID)});Reset(ComboBox2)

Address (DataCardValue6)

  • Default: varSite.SiteAddress

Department (ComboBox2), No defaults set, Items list is filtered from Site Name

 

Edit Form

Site Name (ComboBox1_1)

  • OnChange: UpdateContext({varSite:LookUp('CompanySiteDepartment',ComboBox1_1.Selected.Result = SiteID)});Reset(ComboBox2_1);
  • DefaultSelectedItems: [Parent.Default]

Address (DataCardValue6_1)

  • Default: ThisItem.Delivery_Address

Department (ComboBox2_1)

  • DefaultSelectedItems: [Parent.Default]

 

Issue: when the user gets to the edit screen, the defaults all reflect what's currently stored on the record. But, when user changes the site, it needs to still update the Address (to the varSite.DeliveryAddress value) and clear the Department default to blank.

Ideas?

Update: I figured out the Delivery Address one by creating a variable that I set on the button to get to the edit screen and then OnChange for the Site Name. However, I am still stuck on how to clear out the Department text box.

1 ACCEPTED SOLUTION

Accepted Solutions
Helper II
Helper II

added variables for the defaults instead, and set them on appropriate properties

View solution in original post

1 REPLY 1
Helper II
Helper II

added variables for the defaults instead, and set them on appropriate properties

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (10,720)