15
Views
9
Comments
Solved
[Seat Map Selector UI] Assigning Booked Seats as Occupied
seat-map-selector-ui
Reactive icon
Forge asset by João Gonçalves
Application Type
Reactive

So I have the seats being created but I would like to lookup a list of bookings which has a column for seatnumber as Row+Column. 

In the loop of creating a seat there is an assign element of RowSeat.IsOccupied and if that seat appears in bookings list I would like to change it to True if it doesn't appear then it should be False. 

I have created a loop to try and do this but hasn't worked and have noticed that really the SeatIsBooked node that changes a local variable (default False) to True should not loop back to the bookings for each, but should go somewhere else but cant work out where as each time I get an Ambiguous paths to For Each in OnAfterFetch. message.

Any help or anyone able to point me in the right direction would be greatly appreciated.

 

2021-04-09 11-42-43
assif_tiger
 
MVP
Solution


Hi @Connor Eaton
Fixed your attached OML as well.

https://assif.outsystemscloud.com/SampleSeating/SeatMap?_ts=638817227051361152


Although I would recommend you to save column & seat as well in booking table for better control. But I kept your structure as it is & fixed the OnAfterFetch

1- Prepare the Master List 
2- Populated the existingBooking
3- Loop on MasterList
4- Find if any booking exist under column

5- If yes then, Filter ExistingBookingData by Master-Col
6- Loop on all ExisitingSeats of the filtered Columns
7- Loop on All Seats of Master_Filtered-Col
8- Compare Seat & Mark as Occupied : True





Good Luck

Assif

ResolvedSampleSeating.oml
2022-12-22 10-00-39
Beatriz Sabino
Solution

Hi Connor,

Here is another possible solution for your use case.  

Below the widget is displayed a list with the booked seats.

SampleSeating_updated.oml
2022-12-22 10-00-39
Beatriz Sabino

Hi Connor,

Would it be possible for you to share an example .oml file with your use case? 

I think you can use a list, and append the seat number to the list once it's marked as occupied. 

UserImage.jpg
Connor Eaton

Hi, 

I have created a basic version of the page as an example .oml

SampleSeating.oml
2021-04-09 11-42-43
assif_tiger
 
MVP
Solution


Hi @Connor Eaton
Fixed your attached OML as well.

https://assif.outsystemscloud.com/SampleSeating/SeatMap?_ts=638817227051361152


Although I would recommend you to save column & seat as well in booking table for better control. But I kept your structure as it is & fixed the OnAfterFetch

1- Prepare the Master List 
2- Populated the existingBooking
3- Loop on MasterList
4- Find if any booking exist under column

5- If yes then, Filter ExistingBookingData by Master-Col
6- Loop on all ExisitingSeats of the filtered Columns
7- Loop on All Seats of Master_Filtered-Col
8- Compare Seat & Mark as Occupied : True





Good Luck

Assif

ResolvedSampleSeating.oml
2022-12-22 10-00-39
Beatriz Sabino
Solution

Hi Connor,

Here is another possible solution for your use case.  

Below the widget is displayed a list with the booked seats.

SampleSeating_updated.oml
UserImage.jpg
Connor Eaton

Perfect, that works.

Thank you very much for your help with this

2021-04-09 11-42-43
assif_tiger
 
MVP

Hi @Connor Eaton 

Please find the attached sample.
I had created a sample booking-data list i.e ExisitingSeatList

This list I am merging to the MasteList


Demo :
https://assif.outsystemscloud.com/SeatMapSelectorUI_DEMO/Teste?_ts=638817214056904352


As you can see... the seat is now occupied in master data :) 

SeatMapSelectorUI_DEMO.oml
UserImage.jpg
Connor Eaton

Thank you for this,

In my bookings list, I store the seatID as "2B" (Row+Column)(I have changed the default seating so that rows are numbers and columns are letters), so would I need to split this into separate rows and columns?

2021-04-09 11-42-43
assif_tiger
 
MVP

Check my reply above.. I also fixed your OML 
https://www.outsystems.com/forums/discussion/102642/assigning-booked-seats-as-occupied/#Post449847

or refer the attached below
this is based on your OML ; where you are storing the Booking as concatinated string.


If you split and store it would be easy fo you for future purpose...

ResolvedSampleSeating.oml
UserImage.jpg
Connor Eaton

Sorry, yes saw this after I had posted.

Thank you very much for your help with this

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.