cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobRoy
Level: Powered On

Re: Set default selection for drop-down in Edit Form

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

jlarsen81
Level: Powered On

Re: Set default selection for drop-down in Edit Form

It sounds like the dropdown is not connected as the update value for that card, it should look like this DropdownName.Selected.Value. You may want to check that out. Also the default property should simply be ThisItem.ColumnName. If these are correct and you're still getting the error, this might help you get back to where you were before the change.

 

https://powerapps.microsoft.com/en-us/guided-learning/learning-manage-version-apps/

RobRoy
Level: Powered On

Re: Set default selection for drop-down in Edit Form

Thank you, setting the defaults back to ThisItem solved the issue with the Edit values switching to my defaults. So now I am back to not being able to set default values. I still see the Server error message when clicking the check box. I have checked all my fields for Defaults and Updates and they all seem to be correct. I am wondering if my context variable is causing the issue:

 

Item.jpg

 

This context variable (galleryvar1) is in place because I have three galleries, each with their own navigation heading.

 

I should point out this happens when editing an existing item and also when trying to create a new item. So currently I cannot enter any data into my Sharepoint list via this app.

 

jlarsen81
Level: Powered On

Re: Set default selection for drop-down in Edit Form

Not sure if the context variable has anything to do with that. You might want to duplicate your edit screen and use that as your new form. This will allow you to have the edit form keep it's values correct on the dropdowns, while also giving you a way to show default values in the new form. You might also try removing the items property from the duplicate and see if that fixes the server error.

RobRoy
Level: Powered On

Re: Set default selection for drop-down in Edit Form

I was able to restore the original dropdown boxes by deleting the data cards and creating new cards with dropdown controls. I then tried experimenting more wth the Distinct () function to try and restore the ability to have default choices for NewForm, but no luck.

KiranKr
Level: Power Up

Re: Set default selection for drop-down in Edit Form

Set the DefaultSelectedItems property of Dropdown control (showing Homes to the following formula:

LookUp(Choices(SharePointListOfEvents.LookupColumnForHome),Value=ListOfHomesGallery.Selected.Title)

Anonymous
Not applicable

Re: Set default selection for drop-down in Edit Form

KiranKR's response worked perfectly for me

CindyZ
Level: Powered On

Re: Set default selection for drop-down in Edit Form

KiranKr -- Thanks sooooo, sooo much!  This same formula did it for me after hours of searching and trying!  Really appreciate when people take the time to share their knowledge!   

KiranKr
Level: Power Up

Re: Set default selection for drop-down in Edit Form

Thank you. That contribution was first time in my life!

andreaswaldher
Level: Power Up

Re: Set default selection for drop-down in Edit Form

Hi KiranKr!

 

Thanks a lot for your posting! Thats the way how it works 🙂

 

Andreas

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,010)