cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PJBruen
Resolver I
Resolver I

How to reset a Dropdown box that has a DefaultSelectedItems

I have a PERSON dropdown field on SHEET2 that has a DefaultSelecteditems property of: Office365Users.SearchUser({searchTerm:DD_LineManagerPSF.Selected.DisplayName})

 

The idea being that this dropdown will default to the value of DD_LineManagerPSF from SHEET1, if there is a value there.

However, in circumstances where the user does not navigate through SHEET1, I would like the person dropdown to simply revert to "Find items" (a per all other Person dropdowns I have).  Presently what is happening, where the user doesn't navigate through Sheet1, is that it populates the dropdown with a random Person......which is just odd, so I'd like it to default to "Find items".

 

How can I achieve this?

 

I've tried putting Reset(DD_LineManagerHYP) (that's the field in question)in a number of locations, but that doesn't seem to work.

I've also tried wrapping the DefaultSelectedItems statement in an "If" to default to Parent.Default based on the value of a variable, but that doesn't work either.

 

Does anyone have a solution please?

Cheers.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@PJBruen 

First, using the Reset function will reset a control to its Defaults.  In your case, the Defaults are the DefaultSelectedItems (DSI).  So, it will always reset to that value.

 

If you want to set the DSI blank, then consider some logic in the DSI formula.

Ex.

If(IsBlank(DD_LineManagerPSF.Selected.DisplayName), 
    Blank(),
    Office365Users.SearchUser({searchTerm:DD_LineManagerPSF.Selected.DisplayName})
)

 

Also, consider using SearchUserV2 as the SearchUser action is now deprecated. 

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
AmDev
Super User
Super User

Hi @PJBruen 

 

Can you try:

 

If(

IsBlank(DD_LineManagerPSF.Selected.DisplayName),

"Find Items",

Office365Users.SearchUser({searchTerm:DD_LineManagerPSF.Selected.DisplayName})

)

RandyHayes
Super User
Super User

@PJBruen 

First, using the Reset function will reset a control to its Defaults.  In your case, the Defaults are the DefaultSelectedItems (DSI).  So, it will always reset to that value.

 

If you want to set the DSI blank, then consider some logic in the DSI formula.

Ex.

If(IsBlank(DD_LineManagerPSF.Selected.DisplayName), 
    Blank(),
    Office365Users.SearchUser({searchTerm:DD_LineManagerPSF.Selected.DisplayName})
)

 

Also, consider using SearchUserV2 as the SearchUser action is now deprecated. 

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
PJBruen
Resolver I
Resolver I

Excellent - thanks @RandyHayes 

Was sure I tried something that looked very similar to this, but this worked great (and updated to Search V2).

 

Cheers.

Paul

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.

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 (2,199)