cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerAppsDawg
Frequent Visitor

Filtering a combobox by another combobox that uses a lookup column as a datasource

Hi all,

 

I have two comboboxes in a sharepoint form powerapp. The powerapp is drawn from a list that has a column " shared status" in it. Shared status is in list a and looked up from list B. Its a choice column.

 

What im trying to do is filter shared status by a secondary multi choice column in list A  via a combo box in the app. Effectively if Shared status matches the condition or conditions specified in the secondary column , its corresponding combo box reduces its choices down to match.

 

I thought it would be as simple as putting the below on the combo box I want to filter. But the results in the target are blank.

 

Filter(
'Stakeholder Requirements'.'Shared Status',
'Shared Status' in ComboBox1.SelectedItems.Value

 

can anyone advise ..

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@PowerAppsDawg,

Based on the issue that you mentioned, do you want to filter 'shared status' Combo Box choices based on another Combo Box?

Could you please share a bit more about the scnenario?

In my scenario, I have a SP list as below:qqq.png

Add 2 Combo Box, Combo Box3 for secondary multi choice column Wether, Combo Box4 for Lookup column 'shared status' .

Set Items property of Combo Box3:

Choices(tSheets2.Wether)

Set Items property of Combo Box3:

Distinct(
    ForAll(
        Ungroup(
            Filter(
                tSheets2,
                CountRows(
                    Filter(
                        ForAll(
                            Wether.Value,
                            If(
                                Value in ComboBox3.SelectedItems.Value,
                                {t: 1},
                                {t: 0}
                            )
                        ),
                        t = 1
                    )
                ) <= CountRows(ComboBox3.SelectedItems.Value)
            ),
            "Wether"
        ).'shared status',
        'shared status'
    ),
    Value
)

mmm.png

Note: This formula will not lookup the shared status one by one correspondence, if you want this, please modify the operator "<=" to "=".

Hope it could help.

Regards,

Qi

Best Regards,
Qi

View solution in original post

1 REPLY 1
v-qiaqi-msft
Community Support
Community Support

Hi@PowerAppsDawg,

Based on the issue that you mentioned, do you want to filter 'shared status' Combo Box choices based on another Combo Box?

Could you please share a bit more about the scnenario?

In my scenario, I have a SP list as below:qqq.png

Add 2 Combo Box, Combo Box3 for secondary multi choice column Wether, Combo Box4 for Lookup column 'shared status' .

Set Items property of Combo Box3:

Choices(tSheets2.Wether)

Set Items property of Combo Box3:

Distinct(
    ForAll(
        Ungroup(
            Filter(
                tSheets2,
                CountRows(
                    Filter(
                        ForAll(
                            Wether.Value,
                            If(
                                Value in ComboBox3.SelectedItems.Value,
                                {t: 1},
                                {t: 0}
                            )
                        ),
                        t = 1
                    )
                ) <= CountRows(ComboBox3.SelectedItems.Value)
            ),
            "Wether"
        ).'shared status',
        'shared status'
    ),
    Value
)

mmm.png

Note: This formula will not lookup the shared status one by one correspondence, if you want this, please modify the operator "<=" to "=".

Hope it could help.

Regards,

Qi

Best Regards,
Qi

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,991)