cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
calvares
Continued Contributor
Continued Contributor

Default value of combobox not recognised as selected

I have a Department field (FilterDatasetDept) in my form which is single line of text. I use a combobox inside the data card to allow the user to pick from a list of departments. Items is set to Departments.Title.

 

At the same time I want the default value of the combobox to be set to a variable varDept if the Department field is otherwise blank.

So DefaultSelectedItems is:

 

If(IsBlank(ThisItem.FilterProjectDept), {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", ID: -1, Value: varDept}, {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", ID: -1, Value: ThisItem.FilterProjectDept})

 

 

This works fine in terms of displaying the value in the combobox. Update of the datacard is set to ComboBox.Selected.Title. The form is submitted to SharePoint. However no value is being passed back. I've also tried setting the datacardvalue of the datacard to ComboBox.Selected.Title but it also appears blank.

If I actually select another value from the list this does update though.

 

Any ideas what could be going wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @calvares ,

 

Try below code if it helps. Here I'm considering title is mapped column of combobox. 

 

DefaultSelectedItems : If(IsBlank(ThisItem.FilterProjectDept), {Title : varDept},{Title :ThisItem.FilterProjectDept})



Save with: ComboBox.Selected.Title

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

2 REPLIES 2
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @calvares ,

 

Try below code if it helps. Here I'm considering title is mapped column of combobox. 

 

DefaultSelectedItems : If(IsBlank(ThisItem.FilterProjectDept), {Title : varDept},{Title :ThisItem.FilterProjectDept})



Save with: ComboBox.Selected.Title

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

calvares
Continued Contributor
Continued Contributor

Brilliant thank you @PG_WorXz10 . That worked!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,666)