web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Modifying the 'Book a ...
Power Apps
Unanswered

Modifying the 'Book a Room' Template to see Room Lists 'CustomAttribute' to identify Hot desks

(0) ShareShare
ReportReport
Posted on by

Hello!

 

We're Power Apps novices and are looking to see if we can replace our legacy Room and Hot desk booking system with a Power App...

 

We've started to play with the 'Book a Room' Template and have set up some test Room Lists in EXO to organise the few hundred rooms that we have, and that's working great. Where we've got stuck however is that we would also like to modify this Power App to allow our people to book Hot desks (that we create as Resources within EXO). Of course, we could just show the 'Room-Room Lists' and the 'Hot desk-Room Lists' on the same screen, but it's not a great experience and it could be improved massively if we were able to have two separate processes for each.

 

The way we hoped to achieve this was by using 'CustomAttribute1' for each Room List to distinguish between the values, 'Rooms' and 'Hot Desks'.

 

Any ideas on how can achieve this? Is it even possible to get the Power App to see 'CustomAttribute1'? All help would be greatly appreciated! 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Been reading a few other posts and I'm wondering whether it's easier to filter the two different types of Room Lists we're creating by just using the naming convention instead? (If 'CustomAttribute1' can't be surfaced.)

     

    We're using the following name convention for the Room Lists:

    "Placename - Meeting Rooms"

    "Placename - Hot Desks"

  • cchannon Profile Picture
    4,702 Moderator on at

    I haven't worked with that particular template, so I am jumping to a few assumptions here, so check me on these before you give any weight to my response...

     

    • The "room list" the template uses is a spreadsheet in OneDrive or a table in Blob or something, right?
    • You want to add a button or something that would toggle a Gallery between Rooms and HotDesks so users could search for either one
    • The powerapp takes you on to subsequent screens after the user's Selection, so you probably don't want to have to use different data sources for rooms vs desks or anything significant like that which might cause you to need to branch the app.

    So, assuming I've pretty much hit the mark there, what you're realistically looking at is a 3 step process:

    1. Add an attribute to the resources data source.
      1. You will want to add a column to the data source which is either Room or HotDesk. Give the column a useful name, like "RoomType"
    2. Add a global Param called RoomTypeGlobal
      1. From your button or toggle or whatever you use to switch between Room and Desk, have a Switch statement that toggles the Global Param between "Room" and "HotDesk" something like Switch(myToggle, True, Set(RoomTypeGlobal, "Room"), False, Set(RoomTypeGlobal, "HotDesk"))  ****I am just free-handing this so the syntax is probably wrong there; just use it as a basic example
    3. On your Gallery, add a Filter for RoomType
      1. In the dataset for your gallery, you can add custom operations to narrow the results using a Filter. In your case, if the above is all done, then you want to filter the "Rooms" based on when the RoomType column equals the RoomType global parameter. So, that would be something like Filter(myDataset, RoomType = RoomTypeGlobal)

    ...And that should pretty much do it.

  • Community Power Platform Member Profile Picture
    on at

    Hi @cchannon - I think this template uses the Common Data Service? Certainly the only Connections it has it to 'Office 365 Outlook' and 'Office 365 Users'. And the Room Lists are a specific type of 'Distribution Group' within Exchange Online. So as far as I'm aware there's no spreadsheet/database that we can modify for this. It's all what's available within our Office 365 tenant already.

  • cchannon Profile Picture
    4,702 Moderator on at

    ***updated: switched from Left() to Right() after re-reading your earlier post

     

    OK, I just loaded up the template to take a look, and, well that's pretty interesting. Without digging way deep into how they set up those datasources, I guess we can just shortcut things a bit. Not my favorite thing to do as a developer, but if your room naming convention permits, then we can just string match our way to this.

    So, forget what I said about adding a column to your dataset, BUT, you still will need that button/toggle/whatever and the global param. Then, when you add your Filter to the dataset, you will be matching to the Name: 

     

     

    Search(Filter(RoomsLists, Right(Name, Len(roomTypeGlobal)) = roomTypeGlobal), SearchBox1.Text, "Name")

     

     

     I've inserted it here inside the Search line of the room list gallery. I'll break it down to explain what I am doing:

    • Filter() function trims out any results from the collection that do not match the criteria given.
    • Right() grabs the last N characters of a string 
    • Len() gets the length of a string

    So, we have a Global called roomTypeGlobal. It is a string, and it is either "Meeting Rooms" (13 characters) or "Hot Desks" (9 characters). We want to only display rooms where they begin with either Meeting Rooms or Hot Desks, depending on which is currently set to the Global param. So, tracking from the inside of the formula out, we:

    • Get the length of the global (9 or 13)
    • Get the last N characters of the room name (9 or 13)
    • Compare the global to the last N characters and throw away any results that don't match
    • THEN perform the search that the user types in.

    Hopefully this solves your issue! Mark as resolved if it does!

  • Community Power Platform Member Profile Picture
    on at

    Thanks for coming back to me @cchannon !

     

    I have had a read through your recommendations a couple of times and think I understand what you're saying. It has made we wonder however if there's something even simpler we could potentially do for the two Room Lists search screens... As we have 1 screen dedicated to booking Rooms and another dedicated to booking Hot desks, could we just modify the Results Search command?

     

    Right now for both it's:

     

    Search(RoomsLists, SearchBox1.Text, "Name")

     

     

    Sticking with the same idea of using the Name to do the filtering, are we able to use an 'EndsWith' function to find 'Hot Desks' or 'Meeting Rooms' on each screen? (So EndsWith 'Hot Desks' on the Hot desk Room List screen, and EndsWith 'Meeting Rooms' on the Rooms Room List screen?)

     

    Do you think that would work? And do you have any idea how we add that to the Search command that already exists?

  • Verified answer
    cchannon Profile Picture
    4,702 Moderator on at

    Yes, there is an EndsWith function you can use for this purpose. It would work just the same way as the Filter I wrote above, just save you the step of checking Len().

     

    Search(Filter(RoomsLists, EndsWith(Name, roomTypeGlobal)), SearchBox1.Text, "Name")

     

  • Community Power Platform Member Profile Picture
    on at

    Thanks @cchannon - That did the trick.

     

    So for others that may refer to this...

    For the Room booking page we now have:

     

    Search(Filter(RoomsLists, EndsWith(Name, "Meeting Rooms")), SearchBox1.Text, "Name")

     

    And for the Hot desk booking page it's:

     

    Search(Filter(RoomsLists, EndsWith(Name, "Hot Desks")), SearchBox1.Text, "Name")​

     

    This is because our Room Lists within EXO have a naming convention which uses "Placename - Meeting Rooms" and "Placename - Hot Desks".

     

    When we duplicated the original screens to have the Hot desk equivalent screens, we had to work through to update some of the references to the new duplicated elements. This took some trial and error, but was fairly simple.

     

    This means we could use the Book a Room template to provide a booking mechanism for meeting rooms and hot desks within our organisation. 👍

  • kflinchum Profile Picture
    10 on at

    Does anyone know if you can have two different sets of rooms?  I need Training Room with 10 stations then 3rd Floor Stations with 20 stations......I cannot seem to figure out the Book a Room app to have one Book a Room for each ???  Is there a way to have multiple instances of the app?

  • MCosy Profile Picture
    11 on at

    Hi, Can you share the modified App?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard