cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Set default selection for drop-down in a new Form

Hello.

 

I have an app wich the data source is Sahrepoint List, that list has a "choice" item ('New', 'Closed', 'Open').

 

Is there currently a way to set a default selection in a DataCardValue (dropdown) as 'New' when ForMode is "New"?

 

Thanks in advance

15 REPLIES 15
Highlighted

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

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

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

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.

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

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!

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 (11,027)