Question
FAA
US
Last activity: 24 Sep 2020 19:24 EDT
Count and Display number of cases with particular Data Reference
I am trying to accomplish a task I believe should be relatively simple, but even after a lot of research in the community and training courses I am unable to accomplish my goal.
I have a case type called Reservation. Each case instance represents a reservation for a seat on a shuttle. Each case is linked via a data reference to a local "Flights" data type. Flights keeps a list of the available shuttle flights.
There is a seat number of seats for each flight. During the Reservation flow, the user selects a particular flight instance. My idea is to count the number of Reservations already associated with a particular flight instance, subtract that from the known number of seats, and show the user making the reservation if there are any seats available.
For the life of me, I haven't figured out how to do this. I created a report that shows the count of reservations for a particular flight, but that is a long way from my goal of preventing the user from reserving a flight with no available seats.
It would be nice to let the user know that no seats are available, but at this point, I would settle for just not showing a flight in the list that is full (FYI, I use a report to show the list of available flights).
Any thoughts on how one might approach this use case?
***Edited by Moderator Marissa to update platform capability tags****