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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (51,751)