cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Digital
Responsive Resident
Responsive Resident

Combobox - DefaultSelectedItems selection tags visible in field but not actually selected

 

 

I have inserted a combo box into a form data card and changed the Update property to the new combo box.

 

The combo box items property is a collection of parts populated by a SharePoint list. The idea is user can search for and select multiple parts. The selected parts then get saved as comma separated string to a SharePoint list called Returns.

 

My collection of parts is a single column table

 

ClearCollect(
    colParts,
    RenameColumns(
    ShowColumns(
        Products,
        "Product_ID"
    ),
    "Product_ID","Title")
);

 

 

In the DefaultSelectedItems property of the combo box I have performed a split operation to get a table of the selected parts. 

 

 

 

ForAll(
    Split(
        Parent.Default,
        ","
    ),
    {Value:Result}
)

 

 

The saved items display fine in the combobox, but they aren't actually 'selected'. For example if I try to reference the combo box SelectedItems I get no result despite the items displaying selection tags. I'm also able to select the same items again, instead of the usual behaviour of that item being removed.

 

Screen Shot 2020-12-23 at 15.38.57.png

 

I imagine this is something to do with the combo box having a different data source from the form. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Digital :

Could you tell me what the combo box's items property is?Is it 'colParts‘.

If so,the DefaultSelectedItems  property should be:

 

ForAll(
    Split(
        Parent.Default,
        ","
    ),
    {Title:Result}
)

 

According to my experience, the usual reasons for the problems you describe are:
The items in the DefaultSelectedItems property do not belong to the data source of this combo box.

If the data source of your combox is'colParts', then it is a single list named 'Title'. The value of ForAll(Split(Parent.Default,","),{Value:Result}) is a single list with the column name ‘Value’. The data structure of the two is inconsistent, which causes the value of the selecteditems attribute you quoted to be empty.

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @Digital :

Could you tell me what the combo box's items property is?Is it 'colParts‘.

If so,the DefaultSelectedItems  property should be:

 

ForAll(
    Split(
        Parent.Default,
        ","
    ),
    {Title:Result}
)

 

According to my experience, the usual reasons for the problems you describe are:
The items in the DefaultSelectedItems property do not belong to the data source of this combo box.

If the data source of your combox is'colParts', then it is a single list named 'Title'. The value of ForAll(Split(Parent.Default,","),{Value:Result}) is a single list with the column name ‘Value’. The data structure of the two is inconsistent, which causes the value of the selecteditems attribute you quoted to be empty.

Best Regards,

Bof

View solution in original post

Digital
Responsive Resident
Responsive Resident

@v-bofeng-msft ,

 

Thank you this solved the problem. Yes my combo box items property is colParts. I have now changed the DefaultSelectedItems to refer to Title.

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

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

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (86,080)