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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set default selection ...
Power Apps
Answered

Set default selection for drop-down in Edit Form

(1) ShareShare
ReportReport
Posted on by 111

Hello,

 

i have seen many posts here on the subject of drop-downs but still cannot figure out how to do this. In DataCard14 I have a drop-down box in my New Form(DataCardValue14). The data source is the Events table. Events has a lookup field from the Homes table. I want a value from Homes to prepopulate this drop-down control as the default for the New Form.

 

Thanks!

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    on at

    Hi RobRoy,

     

    Could you provide more details about your scenario?


    Where does the data source “Events” table come from? Is it a custom entity in Common Data Service? How is it configured?
    What’s the Home table?

    Have you already created a Relationship between Events table and Homes table?


    Best regards,
    Mabel Mao

  • RobRoy Profile Picture
    111 on at

    Thank you for your response. My Powerapp is built from a SharePoint Online list. Events is the main table with relationships to three other tables (Homes, Employers, Eras) that are the source of the dropdown controls. When I create a new record I would like specific values from those three tables to already be selected in each dropdown. I tried messing with the Default values based on other posts but nothing changes.

  • jlarsen81 Profile Picture
    51 on at

    I am by no means an expert in PowerApps, but I think if it could work, it would be accomplished in the Items property of your dropdown. Something like this maybe:

    DropDown1.Items=Distinct('Events',lookup column title)

    DropDown1.Default="desired default item"

    This will only work with a list smaller than 500 items because of delegation inablilities, though. And it might not work with a lookup column, but if the data shows in the gallery, it should be available for a dropdown.

  • RobRoy Profile Picture
    111 on at

    Thank you for responding. My dropdowns are DataCards, and they don't appear to have an Items field. They do have Default fields, but changing this field from Parent.Default does nothing at the DataCardValue level, and changing ThisItem.MyRecordID at the DataCard level also does nothing. I am guessing this is becuase I am looking at the EditForm version, not the NewForm state, but I have no idea how to access that nor if I need to.

     

    I really thought this would be as easy as it is in Access.

     

    Thanks.

  • jlarsen81 Profile Picture
    51 on at

    I apologize if I'm being presumptuous here, but there should be 2 parts to every DataCard, the DataCardKey, and the DataCardValue. The dropdown should be the DataCardValue part of the DataCard. If you click on the more options button, and scroll down, you should see "the name of your dropdown".Items, this would be the Items field for the dropdown, directly below that should be " ".Default. If your DataCard is unlocked you should be able to edit these fields with the previous replies' statements. It may or may not work, but it's probably worth a try.

    The fields you're looking for are circled below:

    DataCardValue.jpg

     

  • RobRoy Profile Picture
    111 on at

    Very interesting. I double-checked for that field you circled and it does not appear:

     

    DataCard.jpg

  • Verified answer
    jlarsen81 Profile Picture
    51 on at

    Is this like what you are trying to accomplish?

     

    dd1.jpg

     

    Apparently what I had posted earlier only shows up when you have already inserted the dropdown into the DataCard, replacing the TextInput box, and, have added something into the Items field for the DataCardValue, as shown in the attached picture.

  • v-yamao-msft Profile Picture
    on at

    Hi RobRoy,

     

    My understanding is that you have four lists on SharePoint, the main list Events, and three other lists Homes, Employees, Eras.
    On Edit form, you want to specific values from these three tables.


    Per my understanding, I would suggest you add connections from PowerApps to all these lists, then add three drop down controls and set the Items property of each drop down to the lists.

    e.g. About list Homes, you could set the Items property of Drop down1 control as: Distinct(Homes, Column Name)

     

    Please try if this works for you. If I misunderstand you, please feel free correct me.

     

    Best regards,
    Mabel Mao

  • RobRoy Profile Picture
    111 on at

    Thanks, everyone! I did have to create new dropdown controls to get the Items option that enabed me to set the default using the Distinct function. I also connected to the individual child tables as suggested but I don't know now if I had to do that. In any event, it finally works.

  • RobRoy Profile Picture
    111 on at

    Oops, I may have spoken too soon. I thought I tested this before and it worked, so I may have done something else that broke. Although my default values do indeed show up when creating a new entry, trying to submit the form via the standard "check" button returns an error: "The requested operation is invalid. Server Response: A value must be provide for item." Also, when I edit items in the EditForm, the previous records become replaced with my default items due to the Distinct() function.

     

    Unfortunatley I cannot seem to "roll back" to before I had default items because there is a difference between what PowerApps generates and when you drag dropdown controls manually from the Content tab. (i.e., no Items field).

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard