0

I have this formula as part of a combobox items property:-

Filter(
    Distinct(colRelatedPostingUnPostingForms, 'Location Name') As v, v.Value in ShowColumns(Filter(Locations,
    StreetTitleSync in ShowColumns(PostingFormStreetComboBox.SelectedItems,"Title")),"Title"))

the idea is that i only want to show the Location Name for the selected Streets from the PostingFormStreetComboBox... but currently i am getting that the ShowColumns has some invalid arguments.. any advice?

2 Answers 2

0

This is a characteristic of forms in Power Apps canvas apps. While generally you can reference a control's .SelectedItems property in such scenarios, you can't if the control happens to be in a form card. As a workaround, you should use ClearCollect in the control's OnChange to temporarily store the values in a collection. The collection will be accepted in your ShowColumns expression.

0

See: https://powerusers.microsoft.com/t5/Building-Power-Apps/ShowColumns-DropColumns-based-on-ComboBox-SelectedItems-or/td-p/867702

In PowerApps, ShowColumns is used to create a new table with only the specified columns from an existing table. It expects a table as its first argument and one or more column names as subsequent arguments.

You’re trying to use ShowColumns to filter a table based on the selected items in a ComboBox, which is not its intended use. Use filter

Filter(
    Distinct(colRelatedPostingUnPostingForms, 'Location Name') As v, 
    v.Value in Filter(Locations, StreetTitleSync in PostingFormStreetComboBox.SelectedItems.Title).Title
)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.