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

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.

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)

 

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.

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.

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,835)