web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to set a pre-popul...
Power Apps
Answered

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

(3) ShareShare
ReportReport
Posted on by 42

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

  PowerApps1.JPGPowerApps2.JPG

 

Thank you so much for your help.

 

Regards,

ejules

Categories:
I have the same question (0)
  • hpkeong Profile Picture
    2,944 on at

    Hi @ejules

     

    The Default is "Parent.Default"

    - This is to append any existing data (if any) or blank if none.

     

    However, if you wish to change, you need to select

    - Advanced

    - Unlock (you can see the icon, just click on it)

     

    Then you may change the Default to:

    - If(IsBlank(One of your datafield), "Inland", Parent.Default)

     

    In this case, when you are

    - Add a new item, most of the TextInput will be BLANK (but not default value such as createddate, Auto-ID,..), so it will detect that this is a NEW record and will set the Dropdown1.Default = "Inland".

     

    If you are unsure of the items, you may use:

    - First(YourDropDown).

     

    Hope this helps.

  • ejules Profile Picture
    42 on at

    Hi @hpkeong,

     

    Thank you very much for your response. Unfortunately I still get an error:

    powerapps

    Error Reads: "Invalid Argument Type (Record). Expecting a Text Value instead.

    I somehow seem to be unable to assign a "Text" directly as a Default to a DropDown. I believe it has to do with the fact that I would need to choose an Item of a list somehow?

    For Example: If(IsBlank(Receipt_Location);Parent.Default;Parent.Default) works.

     

    Thank you very much.

     

    Best,

    Julien

  • hpkeong Profile Picture
    2,944 on at

    Hi

     

    IsBlank(...), would suggest to refer to other blank field, not itself.

    I guess you got it right maybe because your current data contains Inland, which is ismilar to the first record of Dropdown.

    Anyway, I will try to investigate if time allowed.

     

    Happy coding.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Julien (ejules),

     

    You seem to have used semicolons in your If statement instead of commas. That may have caused the error?

     

     

     

  • sruble Profile Picture
    Microsoft Employee on at

    I have the exact same scenario as ejules and I'm running into the same issue.  I also confirmed that I'm using commas and not semi colons.  I have a Choice field from SharePoint called "Feedback Type".  It has 5 values and I want to set the default to "Documentation".

     

    Within the Advanced pane, I put the following italics code in the Default field for the DataField named "Feedback_x0020_Type".

     

    Code:

    If(IsBlank("Feedback_x0020_Type"), "Documentation", Parent.Default)

     

    The error I'm getting is the following:

    Invalid argument type (Record).  Expecting a Text value instead.

     

    Any thoughts on what the problem could be?

     

    Thanks,

    Scott

  • AlexN Profile Picture
    269 on at

    I think the root problem is that the dropdown values are not populated until you click on the dropdown. Therefor there simply isn't any default value which could be selected by the system.

  • sruble Profile Picture
    Microsoft Employee on at

    Is there any way to hardcode a value to set the default?  I was able to do this with a Boolean fields; e.g. by setting Default = true but not choice fields.

     

    Thanks,

    Scott

  • Sienna Profile Picture
    1,532 on at

    If you got table with name "Test" linked to your DropDown with Items set to Name which looks like this..

     

    ID    Name

    1     Selection1

    2     Selection2

     

    Then in your Default property of DropDown write simple

     

    LookUp(Test, ID=2,Name)

     

    Then the default value in your dropdown will be "Selection2"

    Or closer to your situation if you want to check if collection is empty then set the default property to

     

    If(IsEmpty(CollectionName), LookUp(Test,ID=1,Name), LookUp(Test,ID=2,Name)

     

    Adjust it to your needs as you wish and it will work

     

  • sruble Profile Picture
    Microsoft Employee on at

    Sorry - I need a bit more guidance.  Ultimately, I just want to hard code the value "Documentation" as the default for a Choice field.

     

    How and where do I create the table in the PowerApp?  I'm assuming this will just be a single row.

     

    ID

  • sruble Profile Picture
    Microsoft Employee on at

    Sorry - I need a bit more guidance.  Ultimately, I just want to hard code the value "Documentation" as the default for a Choice field.

     

    How and where do I create the table in the PowerApp and make it a global variable?  I'm assuming the table will just be a single row as in the following:

     

    ID     Name

    1      Documentation

     

    Thanks,

    Scott

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard