cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobRoy
Helper III
Helper III

Set default selection for drop-down in Edit Form

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!

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

19 REPLIES 19
v-yamao-msft
Community Support
Community Support

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

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.

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.

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

 

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

 

DataCard.jpg

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.

View solution in original post

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

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,331)