cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User II
Super User II

Re: Set default selection for drop-down in a new Form

The person lookup is more complicated. This code would set the current user as the default value. The code would go into the parent data card of person field just like the other example.

 

If(Edit.Mode = New,     {
        '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        Claims:Concatenate("i:0#.f|membership|",Office365Users.Manager(User().Email).Mail),
        DisplayName:Office365Users.Manager(User().Email).DisplayName,
        Email:Office365Users.Manager(User().Email).Mail
    }, ThisItem.PersonField)



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Kudo Collector
Kudo Collector

Re: Set default selection for drop-down in a new Form

Thank you! Assigning a different user does work.

However, my question and example was about clearing a Person field and for some reason this doesn't work at all:

 

{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:"",Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""}

 

It fails on submitting a form.

If I replace Claims:"" with Claims:Blank() then it somewhat works (submits the form but doesn't clear Person field)

 

Highlighted
Super User II
Super User II

Re: Set default selection for drop-down in a new Form

Are you clearing the person from the Default value or are you doing this in a Patch function?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Kudo Collector
Kudo Collector

Re: Set default selection for drop-down in a new Form

Shortly, I'd like to have a functionality that allows me or a user to clear out a Person field by pressing a button or any other condition.

 

A specific example is what I have in my form. Depending on "Accepted" drop down selection, it either clears out a "Reason for decline" (if "Yes" is selected), OR it clears out "Priority" and "Assigned Engineer" (if "No" is selected) as I don't wanna keep all values in a SP list.

yes.png

no.png

Hopefully it makes sense.

Highlighted
Super User II
Super User II

Re: Set default selection for drop-down in a new Form

There is a function called Reset which will reset a control to its default property value.

 

Reset function in PowerApps



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Kudo Collector
Kudo Collector

Re: Set default selection for drop-down in a new Form

If I am correct, I don't think 'Reset' function is what I need as my form is already saved and my fields are populated in a SP list. (Let's say a manager changed his mind, decides to go back to that document/form, and selects "Not accepted" for that document).

 

Plus it's still kinda strange that with regular lookups I can use either "" (to nullify a lookup) or "some value" (to set a value for a lookup) but I cannot use "" when working with a Person lookup field.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (4,366)