Showing results for 
Search instead for 
Did you mean: 
Advocate I
Advocate I

How to set a pre-populated default value of a Dropdown in EditScreen for a SharePoint Choice field?

Hi Everybody,


I'm currently trying to simply set the Default value of a Dropdown in an Edit Form (Form is opened and the Dropdown should have a pre-selection). Even though I did extensive research I couldn't find a solution for a Sharepoint choice field (as I don't know how to find the ID's of those choices and how to reference it?

I have the DropDown with the Selections from Sharepoint ("Inland", "Ausland") and would like to be the Default for a blank form to be "Inland".



Thank you so much for your help.





Good news @vwyankee 
I had another go with your code today and it worked. The only think I can think of that I did differently was that previously I still had the old code at the bottom of OnStart. I didn't think this would affect it as it had different variable names.

Anyway, I'm back on track now.

Awesome, @GraemeNZ

Perhaps there wasn't a semi-colon to separate the previous code you had below it. Regardless, glad to hear it is working and it's not some MS super mysterious anomaly why it doesn't work for you but does anyone else. Those will come up. 😂

Hi @vwyankee 

I feel like I'm nearly there. Can you please help with one more thing? I want to slightly change your recommendation for the visibility of a datacard in FormMode.New based on whether the current user is a customer. In plain speak I want - If (Form Mode is new and if gvCustomer is not blank), then visible, else hidden)

On the Visible property I've tried this but it doesn't like it.
If(FormMfrEntry.Mode=FormMode.New && If(!IsBlank(gvCustomer),true,false))

Did I just solve it by removing that second If?
If(FormMfrEntry.Mode=FormMode.New && !IsBlank(gvCustomer),true,false)

You've got an unneeded if statement. Just make it:
If(FormMfrEntry.Mode=FormMode.New && !IsBlank(gvCustomer),true,false)

Haha - Looks like we both posted at the same time. Yes, that should be all it was.

@vwyankee You helped previously with adding a search box and a sort ascending/descending button on a gallery. How do I combine this with the functionality that if gvCurrentUser = "FIW Approver" then all items should be shown, but otherwise only the gvCustomer values should be shown?

@GraemeNZ - I didn't help with the search and sort, but you can combine them with the condition on what to show like this - note, I condensed the statement so the condition on what to filter is within one SortByColumns statement instead of having them split out into two full statements. I also added in some comments to help clarify what's happening.


//If current user is approver show all, else filter by gvCustomer
            gvCurrentUser = "FIW Approver",
            'testManufacturers List',
                'testManufacturers List',
                Customer.Value = gvCustomer
        //search from text input box on Title column
    //sort by Title column
    //sort order


If you want to have a sort for each column in your gallery you can do that with a variable as well. @WonderLaura does a great job with the step by step in this video from one of her Power Hour sessions that you can incorporate.

Thanks @vwyankee that worked just fine when I replaced the name of the search box with the name in my app.

Thanks also for the post to @WonderLaura - it turns out I've been watching that video to learn how to filter my gallery, and I've watched a few of her other very helpful videos also. Thanks Laura!

Hi @vwyankee - related to this is a Flow issue I'm having. I don't know how familiar you are with Flow, but I'd be interested in any insight you have. See: 

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,944)