Forum Academy Marketplace Showcase Pricing Features

Add List Of Amenities

Can’t wrap my mind around this today although it should be simple by now…

Trying to add a list of aircraft amenities (lavatory, galley kitchen, A/C plugs, WiFi etc.) to an aircraft.

I have an Aircraft Amentity Thing with an amenity name + on/off as fields.

On aircraft creation, it should search for a list of all amenities in a repeating group and display their name and on/off status switch.

When an aircraft is created, how can I set a list of amenities with checkmark = yes from within the repeating group?

And how can I edit those amenities after the fact so there is the ability to turn on or off any amenity?

What does “set list” “add list”, “remove list” vs. “clear list” etc. do? There are no docs for these commands.

“When an aircraft is created, how can I set a list of amenities with checkmark = yes from within the repeating group?”

You will need to create some sort of temporary list as you go along, suggest a Custom State. So when they are switched on/off you add/remove from the custom state’s list. An alternative is that you create the Aircraft thing (in blank form) when you enter the page, then do the switches directly. This will leave some orphan records if the user quits but that is easily dealt with by having a status.

“And how can I edit those amenities after the fact so there is the ability to turn on or off any amenity?”

You would use add or remove on the list, using a standard “Make Changes to a Thing”.

“What does “set list” “add list”, “remove list” vs. “clear list” etc. do? There are no docs for these commands.”

Set List = Make the list the same as THIS list here (so a custom state which is a list, or a search).
Add List = Add THIS thing to the list
Remove List = Remove THIS thing from the list
Clear List = Remove everything from the list

3 Likes

Mmmmm. More custom states. gotta love em.

Where do I setup the custom state though? And how exactly would the state change occur?

I currently have a list of all aircraft amentities in a repeating group that is displayed when creating a new aircraft:

Do I put the custom state in a group? Is it a number state change?

All aircraft should have all amentites affixed to them, because amentities could be turned on/off at a later date, and they should also be dynamic in the sense that if an Admin ads a new amentity, that amentity is selectable as an amentity later on.

WiFi wasn’t on airplanes until recently for example. Now it’s everywhere.

It doesn’t matter where you put the state. You can put it on the page, which is often what I do so I remember where it is.

So all you are doing is keeping a temporary list of those amenities that have been switched on.

Switch amenity on (so switch has changed, and it is now “on”) - Add the item to the list.
Switch amenity off (so switch has changed, and it is now “off”) - Remove the item from the list…

1 Like

This clears up a lot.

And when I save, I assume I use the “set list” operation and set the list according to the custom state list.

Spot on :slight_smile:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.