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
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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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
Users online (1,492)