Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered

Do a search with two ComboBox with data from a Sharepoint

Posted on 28 Nov 2024 15:44:15 by
Hello, 

I will add picture off the app and the data. You can see on picture 1 (app_view) that I have 2 ComboBox that can have 1 or more value selected. ComboBox1 argument are 'W1', 'W2' and ComboBox3 are id that can be translate to Value if we use NAME.Value. 

The 2 (data) picture is the Data in my sharepoint.
 
I want that if nothing is selected in both ComboBox it show every line of my Table. And if we add selection of ComboBox only the line  where thos informations appear. 

I have two prototype of code to put in the item section of the Gallery here but none of them work :

1 : 
 
If(
    IsBlank(ComboBox1.SelectedItems) && IsBlank(ComboBox3.SelectedItems);
    'APOLLON_2025_BOOKING TS';
    If(
        !IsBlank(ComboBox1.SelectedItems) && !IsBlank(ComboBox3.SelectedItems);
        Filter(
            'APOLLON_2025_BOOKING TS';
            WEEK in ForAll(ComboBox1.SelectedItems; Value) &&
            NAME in ForAll(ComboBox3.SelectedItems; Value)
        );
        If(
            !IsBlank(ComboBox1.SelectedItems);
            Filter(
                'APOLLON_2025_BOOKING TS';
                WEEK in ForAll(ComboBox1.SelectedItems; Value)
            );
            Filter(
                'APOLLON_2025_BOOKING TS';
                NAME in ForAll(ComboBox3.SelectedItems; Value)
            )
        )
    )
)
If(
    IsBlank(ComboBox1.SelectedItems) && IsBlank(ComboBox3.SelectedItems);
    'APOLLON_2025_BOOKING TS',
    If(
        !IsBlank(ComboBox1.SelectedItems) && !IsBlank(ComboBox3.SelectedItems),
        Filter(
            'APOLLON_2025_BOOKING TS',
            WEEK in ForAll(ComboBox1.SelectedItems, Value) &&
            NAME in ForAll(ComboBox3.SelectedItems, Value)
        ),
        If(
            !IsBlank(ComboBox1.SelectedItems),
            Filter(
                'APOLLON_2025_BOOKING TS',
                WEEK in ForAll(ComboBox1.SelectedItems, Value)
            ),
            Filter(
                'APOLLON_2025_BOOKING TS',
                NAME in ForAll(ComboBox3.SelectedItems, Value)
            )
        )
    )
)


2 : 
 
Filter(
    'APOLLON_2025_BOOKING TS';
    (IsBlank(ComboBox1.SelectedItems) || WEEK in ForAll(ComboBox1.SelectedItems; Value)) &&
    (IsBlank(ComboBox3.SelectedItems) || NAME in ForAll(ComboBox3.SelectedItems; Value))
)


I stay available if you need more informations and thanks if you try help me find this solution
  • Suggested answer
    jpespena Profile Picture
    jpespena 200 on 29 Nov 2024 at 02:14:15
    Do a search with two ComboBox with data from a Sharepoint
    Hi,
     
    Try this:
     
    Filter(
        'APOLLON_2025_BOOKING TS';
        Or(
            IsEmpty(ComboBox1.SelectedItems); 
            WEEK in Concat(
               ComboBox1.SelectedItems; 
               Value;
               ', '
             )
         );
         Or(
            IsEmpty(ComboBox3.SelectedItems); 
            NAME in Concat(
               ComboBox3.SelectedItems; 
               Value;
               ', '
             )
         );
    )

     
  • Suggested answer
    CU29110135-0 Profile Picture
    CU29110135-0 on 29 Nov 2024 at 02:09:55
    Do a search with two ComboBox with data from a Sharepoint
    Hi,
     
    Try this:
    Filter(
        'APOLLON_2025_BOOKING TS';
        Or(
            IsEmpty(ComboBox1.SelectedItems); 
            WEEK in Concat(
               ComboBox1.SelectedItems; 
               Value;
               ', '
             )
         );
         Or(
            IsEmpty(ComboBox3.SelectedItems); 
            NAME in Concat(
               ComboBox3.SelectedItems; 
               Value;
               ', '
             )
         );
    )
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,151

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,845

Leaderboard