cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tamras
Level 10

Default or DefaultSelectedItems of comboBox

How do you set the combo box (property based on current row value in the gallery?
I am getting this error This formula uses scope, which is not presently supported for evaluation


I have a gallery pulling data from a collection:

 

 

 

Collect(
    AssignCollection,
    {
        acOrder: CountRows(AssignCollection) + 1,
        acAssignTo: cmbUser.Selected.Mail,
        acTodo: Left(Concat(cmbAction.SelectedItems, Value & "; "),Len(Concat(cmbAction.SelectedItems, Value & "l ")) -2),
        acSave: true,
        acEdit: false
    }
);

 

 

 

Each row in a gallery also has an edit icon where a combo box is displayed with ["Review/Edit", "Approval"] in its items property. When the row is saved, the collection is patched:

 

 

 

Patch(
    AssignCollection,
    ThisItem,
    {
        acEdit: false,
        acAssignTo: txtEmail.Text,
        acTodo: Left(Concat(cmbAction_AppGallery.SelectedItems, Value & "; "),Len(Concat(cmbAction_AppGallery.SelectedItems, Value & "l ")) -2),
        acSave: false,
        acOrder: Value(txtOrder.Text)
    }
)

 

 

 

 

But if no item is selected from the cmbAction_AppGallery combo box and saved, the acTodo field is replaced with blank. 

Basically, I want to set a default value for the combo box based on current value of acTodo column.
I keep getting an error message when I set either the Default or the DefaultSelectedItems property of the combo box to ThisItem.acTodo

I also tried assigning the current acTodo value into a variable then assigned the variable to either default properties but now I'm getting an error Expected Record Value and Expected Table Value.
2019-12-09_1558.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft v-siky-msft
Microsoft

Re: Default or DefaultSelectedItems of comboBox

@Tamras,

 

If you want to set the default value of Combo box, you should set the DefaultSelectedItems property, and the value(ThisItem.acTodo) should be one of "Review/Edit" and "Approval".

Then set the DefaultSelectedItems property as below:

Filter(["Review/Edit", "Approval"],Value=ThisItem.acTodo)

Snipaste_2019-12-11_13-45-26.png

Best regards,

Sik

View solution in original post

2 REPLIES 2
Highlighted
Microsoft v-siky-msft
Microsoft

Re: Default or DefaultSelectedItems of comboBox

@Tamras,

 

If you want to set the default value of Combo box, you should set the DefaultSelectedItems property, and the value(ThisItem.acTodo) should be one of "Review/Edit" and "Approval".

Then set the DefaultSelectedItems property as below:

Filter(["Review/Edit", "Approval"],Value=ThisItem.acTodo)

Snipaste_2019-12-11_13-45-26.png

Best regards,

Sik

View solution in original post

Tamras
Level 10

Re: Default or DefaultSelectedItems of comboBox

@v-siky-msft Thank you so much.  I was just using ThisItem.acTodo as the DefaultSelectedItems property value and I wasn't even thinking of wrapping it with Filter().  👍

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 (5,588)