cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Helper II
Helper II

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

View solution in original post

1 REPLY 1
Highlighted
Helper II
Helper II

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

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,352)