cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
panand99
Solution Supplier
Solution Supplier

Defaut Selectred items - Combo box- In EditForm (Embedded)

Hi,

 

I want to show defualt value of combo box which is depended on another first combo box field that is too coming from another list.

If I changed  the value of first field then its defualt value is sets but when i opened already save form then its not coming.

 

I am using- On First field (combobox-

OnSelect- ClearCollect(valSelected,{Value:DataCardValue2.Selected.'FullName',CityRequired:DataCardValue2.Selected.City,Id:DataCardValue2.Selected.ID});

 

DataCardValue2 is my first combo box field

CityRequired : I want this to be set(Which is sets successfully when i changed the combobox)

 

On my second field- Items: ValSelected

DefualtSelectedItems: valSelected.CityRequired

 

11 REPLIES 11

Thanks @WarrenBelz for your reply.

 

As required:

for city combobox:-

  • The Items of this Combo Box
    • Filter('SPList',StartsWith('Name',DataCardValue2.SearchText))  // DataCardValue2 is the first combobox name
  • Its DefaultSelectedItem
    • Parent.Default
  • The Update of the Data Card it is in - DataCardValue3.Selected
  • Its Name - DataCardValue3
  • The the name and type of field it is writing back to
    • Name:city, lookup.

Please let me know if any other information required.

 

Thank you very much.

 

@panand99 ,

I assume in all of this that the field is actually updating in the list after submission  (as @RandyHayes asked) - if not, the below is not relevant.

You have also not answered @RandyHayes 's question on whether that are single or multi-select - I will assume single for this exercise.

Firstly, your Items should be

Filter(
   'SPList',
   StartsWith(
      'Name',
      DataCardValue2.Selected.Value
   )
) 

although that only solves invalid searches.
To display the item from the list in your control - two things need to be present

 

  • The value to be displayed (from the field in your list) needs to be present in the "schema" of the control Items - in other words it must be a value that is capable of being selected in the control.
  • As the field you are reading from is of  "complex" type (it is a table with two fields Value and Id), you need to tell the Combo Box what to Display in its DefaultSelectedItems

As it is the Value you want displayed and you are reading from a Table in the source. Your original post alluded to the name of cityrequired - you have now stated it is city, so the DefaultSelectedItems should be actually be

{Value:ThisItem.city.Value}

As a footnote on this you honestly do not need Lookup columns unless you are planning giving users bulk data sheet editing in SharePoint and they cause you more unwanted grief than any other type of field (other than maybe Person) that I know of. This video from Shane Young @Shanescows  is worth watching - I stopped using them a long time ago.

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (46,120)