Skip to main content
witoldw0001
September 19, 2022
Question

Taking action on multiple records at once

  • September 19, 2022
  • 3 replies
  • 0 views
Hello! My issue is as follows:

The app serves the purpose of office desks' management, where desks can be booked by users for periods of time. For this case we have two recordTypes: "Desk" and "Booking", and a foreign key that connects them. The "Book this Desk" record action saves the "bookingNumber" to the Desk recordType, but the data for the booking itself is stored in the "Booking" recordType. One of the requirements is that a priviliged user shall be able to book multiple desks for a group of users. We figured that these priviliged users will create groups through the Create Group Smart Service and therefore the Booking will be assigned to a group. That should work fine for assigning multiple users to one Desk, but is there a way to take action on multiple recordsTypes? In this case, to assign one group of users to multiple "Booking" recordTypes, each of which will in turn be assigned to multiple desks (one "Booking" to one "Desk")? I would appreciate if you could share some insight on this.

3 replies

stefanhelzle0001
Brainy
September 19, 2022

Did you consider to allow the selection of multiple desks when creating a new booking? Is the data model already a one-to-many for booking to desks?

witoldw0001
September 19, 2022

Hello Stefan,

First of all, great book, and I'm waiting for the next publication of yours.

Actually, that is something I did not think of. So instead of acting on the Desk recordType, we would create a new Booking recordType instance, which would then accept an array of identifiers for selected Desks, Got it. We just need to make some adjustments in the data model. Does it sound like the way to go?

stefanhelzle0001
Brainy
September 19, 2022

Thanks a lot. Check out my blog at https://appian.rocks for more content and updates on the book.

As you have to deal with a relational database, you cannot store a list of IDs in one fields. Consider to create a data model like this.

DESK <1-*> BOOKING-ITEM <*-1> BOOKING

This is similar to an order and order items.