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

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

View solution in original post

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (47,533)