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
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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