cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobChilds
Helper I
Helper I

Display whole collection in gallery for filtering in Book a Room Template

In the Book a Room template, on RoomSelectScreen page I want the RoomsGallery to display all of the results that are contained in the AvailableRoomEmailName collection.

 

This is because I have a dropdown box to filter the room displayed - this worked fine in testing as I only added a handful of rooms, but as I have now added all rooms (equalling 93) the filter no longer works as the gallery doesn't display all of the collection.

 

Any help would be greatly appreciated.

 

Thanks,

Rob

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Super User
Super User

Hi @RobChilds 

 

The best practice is to use the filter to make sure results are under the configured settings.

 

Example: (Optional Dropdown and Text Search)

With(
    {
        sData: Filter(
            'Issue tracker',
            IsBlank(ComboBox3.SelectedItems.Value) || IsEmpty(ComboBox3.SelectedItems) || Priority.Value = ComboBox3.Selected.Value
        )
    },
    If(
        Not(IsBlank(TextInput2.Text)),
        Search(
            sData,
            TextInput2.Text,
            "Title"
        ),
        sData
    )
)

  

"Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful. "

View solution in original post

5 REPLIES 5
navso
Regular Visitor

Hi @RobChilds ,

 

Try using Filter formula in the Items property of your gallery. Just make sure that you have the latest data from your datasoure/collection.

RobChilds
Helper I
Helper I

Thanks @navso ...

 

I do have a filter but as the gallery doesn't display all items of the collection the filter doesn't work correctly (or rather it only filters the results that are visible, not all the results that are within the collection).

 

Cheers,

Rob

StalinPonnusamy
Super User
Super User

Hi @RobChilds 

 

By default, the app pulls only 500 records. but you can change up to 2000 (Max) through settings.

 

File > Settings > Data row limit

StalinPonnusamy_0-1627661781632.png

 

Limitation:

StalinPonnusamy_1-1627661828932.png

 

Please let us know any questions about the filter that we can help with.

StalinPonnusamy
Super User
Super User

Hi @RobChilds 

 

The best practice is to use the filter to make sure results are under the configured settings.

 

Example: (Optional Dropdown and Text Search)

With(
    {
        sData: Filter(
            'Issue tracker',
            IsBlank(ComboBox3.SelectedItems.Value) || IsEmpty(ComboBox3.SelectedItems) || Priority.Value = ComboBox3.Selected.Value
        )
    },
    If(
        Not(IsBlank(TextInput2.Text)),
        Search(
            sData,
            TextInput2.Text,
            "Title"
        ),
        sData
    )
)

  

"Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful. "

Thanks @StalinPonnusamy 

 

I have a collection (AvailableRoomEmailName) of a maximum of 93 items. These items are displayed in a Gallery (RoomsGallery) which can be filtered by a dropdown.

 

The trouble I'm having is that the gallery doesn't automatically display up to 93 items, it is being limited somehow. 

 

Here's is the code on the OnVisible property of the screen that I think that needs changing to allow the RoomsGallery to display more items...

 

Set(IsPrevRoomSelect, false);

If(DateTimeRoomChange,

    Set(AvailableRoomsCounter, 1);

    UpdateContext({ShowLoading: true});

    Set(RoomsLeft, Blank());

    If(!NoRoomsList,

        ClearCollect(AllRooms, Office365.GetRoomsInRoomList(RoomsListsGallery.Selected.Address).value)

    );

    Set(DateTimeRoomChange, false);

    /*

    If(CountRows(AllRooms) > 20,

        Set(AllRoomsConnector, Concat(FirstN(AllRooms, 20), Address & ";"));

        If(CountRows(AllRooms) > 40,

            Set(AllRoomsConnector1, Concat(LastN(FirstN(AllRooms, 40), 20), Address & ";"))

        ),

        Set(AllRoomsConnector, Concat(AllRooms, Address & ";"))

    );

    */

    Set(AllRoomsConnector, Concat(FirstN(AllRooms, 20), Address & ";"));

 

    

    Concurrent(

        ClearCollect(AvailableRooms, Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector, IsOrganizerOptional: true,

            Start: StartDateTimeUTC, End: EndDateTimeUTC, MeetingDuration: DateDiff(StartDateTime, EndDateTime, Minutes),

            MinimumAttendeePercentage: "1", ActivityDomain: "Unrestricted"})),

 

        If(CountRows(AllRooms) > 20,

            If(CountRows(AllRooms) > 40,

                Set(AllRoomsConnector1, Concat(LastN(FirstN(AllRooms, 40), 20), Address & ";")),

                Set(AllRoomsConnector1, Concat(LastN(AllRooms, CountRows(AllRooms) - 20), Address & ";"))

            );

            ClearCollect(AvailableRooms1, Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector1, IsOrganizerOptional: true,

                Start: StartDateTimeUTC, End: EndDateTimeUTC, MeetingDuration: DateDiff(StartDateTime, EndDateTime, Minutes),

                MinimumAttendeePercentage: "1", ActivityDomain: "Unrestricted"})

            ),

        Clear(AvailableRooms1)

        )

 

    );

    If(CountRows(AllRooms) > 20,

        Collect(AvailableRooms, AvailableRooms1)

    );

    ClearCollect(AvailableRoomsSorted, SortByColumns(First(AvailableRooms).MeetingTimeSuggestions, "Confidence", Descending), If(CountRows(AllRooms) > 20, SortByColumns(Last(AvailableRooms).MeetingTimeSuggestions, "Confidence", Descending)));

 

    ClearCollect(AvailableRoomsConcat, Concat(Filter(First(AvailableRoomsSorted).AttendeeAvailability, Availability = "Free"),

        Attendee.EmailAddress.Address, ","), If(CountRows(AllRooms) > 20, Concat(Filter(Last(AvailableRoomsSorted).AttendeeAvailability, Availability = "Free"),

        Attendee.EmailAddress.Address, ",")));

 

    ClearCollect(AvailableRoomEmails, Split(First(AvailableRoomsConcat).Value, ","), If(CountRows(AllRooms) > 20, Split(Last(AvailableRoomsConcat).Value, ",")));

 

    ClearCollect(AvailableRoomEmailName, Filter(AddColumns(RenameColumns(AvailableRoomEmails, "Result", "Email"), "Name",

        LookUp(AllRooms, Email = Address).Name), Name <> "Car Park Space 1E", Name <> "Car Park Space 2E", Name <> "Car Park Space 3", Name <> "Car Park Space 4", Name <> "Car Park Space 5", Name <> "Car Park Space 6", Name <> "Car Park Space 7", Name <> "RC_Zoom"));

    UpdateContext({ShowLoading: false});

    Set(RoomsLeft, CountRows(AllRooms) - 40 * AvailableRoomsCounter)

);

Clear(AvailableRooms);

Clear(AvailableRooms1);

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,368)