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

Search bar and dropdown filtering with editable grid gallery issue

hi everybody, im looking for some help with an editable grid gallery with dropdowns and search bar filtering. i am following along with a youtube tutorial (https://www.youtube.com/watch?v=wI6SHGQ9ATg) to create an editable grid experience connected to a sharepoint list.

 

i have created two dropdown filters and a search bar, and i am looking for all 3 to work together. right now, both of my dropdowns work fine in view-only mode and filter the data right away, but my search bar only "searches" after this sequence: i input text into the search bar in view-only mode, then i switch to editable grid mode, then finally when i switch back to view-only mode the search has filtered my data according to whatever text i inputted.

 

variable, button, field definitions:

  • Important fields: TitleField (I want my search bar to search this), Field1, Field2
  • Dropdowns: Dropdown1 (linked to Field1), Dropdown2 (linked to Field2)
  • Search bar: TextInput1
  • SPList: sharepoint list data source
  • colName: collection where i store my sharepoint list data
  • varEditGrid: how i switch from editable grid to view only grid
  • ViewEditButton: switches the experience from a view-only grid to of an editable grid when clicked. in the onselect property, i select my "load data" button
    • on select property code:
If(
    varEditGrid,
    If(
        !IsBlank(
            LookUp(
                colName,
                TitleField = Blank() || IsEmpty(Field3) || IsEmpty(Field4) || IsEmpty(Field5) || IsEmpty(Field6) || IsEmpty(Field7) || IsEmpty(Field8)
            )
        ),
        Notify(
            "Please fill required fields",
            NotificationType.Error,
            2000
        ),
        Patch(
            'SPList',
            UpdateIf(
                colName,
                Created = Blank(),
                {ID: Blank()}
            )
        );
        Remove(
            'SPList',
            colDelete
        );
        Clear(colDelete);
        Notify(
            "Grid Data Updated",
            NotificationType.Success,
            2000
        );
        Select(LoadDataButton);
        Set(
            varEditGrid,
            !varEditGrid
        )
    ),
    Set(
        varEditGrid,
        !varEditGrid
    );
    
);
  • LoadDataButton: button which is never visible and functions to create my collection of data from my SP list. my 2 drop-down filters and the search bar are located in the onselect property of this button. 
    • on select property code:
ClearCollect(
    colName,
    If(
        IsBlank(TextInput1.Text),
        If(
            IsBlank(Dropdown1.Selected.Result),
            If(
                IsBlank(Dropdown2.Selected.Result),
                'SPList',
                Filter(
                    'SPList',
                    Field2.Value = Dropdown2.Selected.Result
                )
            ),
            Filter(
                If(
                    IsBlank(Dropdown2.Selected.Result),
                    'SPList',
                    Filter(
                        'SPList',
                        Field2.Value = Dropdown2.Selected.Result
                    )
                ),
                Field1 = Dropdown1.Selected.Result
            )
        ),
        Filter(
            If(
                IsBlank(Dropdown1.Selected.Result),
                If(
                    IsBlank(Dropdown2.Selected.Result),
                    'SPList',
                    Filter(
                        'SPList',
                        Field2.Value = Dropdown2.Selected.Result
                    )
                ),
                Filter(
                    If(
                        IsBlank(Dropdown2.Selected.Result),
                        'SPList',
                        Filter(
                            'SPList',
                            Field2.Value = Dropdown2.Selected.Result
                        )
                    ),
                    Field1 = Dropdown1.Selected.Result
                )
            ),
            StartsWith(
                TitleField,
                TextInput1.Text
            )
        )
    )
)

the basic format of that onselect property is If(IsBlank(TextInput1.Text), big dropdown filter formula, Filter(big dropdown filter formula, StartsWith(TitleField, TextInput1.Text)))

 

  • GridGallery: gallery in the form of a grid that switches between editable and view-only where i show my data. it has nothing in the items property except for sorting ascending/descending connected to a sort icon and context variable. the sorting function here works fine
    • items property code:
SortByColumns(
    colName,
    "ID",
    If(
        SortDescending,
        Descending,
        Ascending
    )
)

 

im pretty sure the issue is located in my ViewEditButton, as my massive if statement with 2 dropdowns and the search bar in my LoadDataButton works perfectly in a different powerapp i made that does not try to do the editable grid gallery format, but rather just uses a plain data table. 

 

sorry for the massive post and probable confusion. if anyone has any advice, i would appreciate it so much!! 

0 REPLIES 0

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 (4,219)