How To Create A LIST Of "Things" Instead of 1 Thing?

I understand how to create a thing of course but how can you create a list of things?

My app collects “Leg Quotes” for “Flight Leg” things inside of an “Itiniary” and I am trying to then create a “total quote” which includes a list of “leg quotes” that need to be created seperately by the user so that they can be displayed seperately to the end user.

How can I create a list of things instead of just one?

Need a way to total up the price, include each individual leg price, inside of the main quote, and attach the quote to the flight itiniary.

No option to add ALL “leg quotes” to the master quote.

I think that first you’re going to have to create a thing for each leg so that you know what to put in the list of legs.

Then you need a field in the thing itinerary of type leg, with list=yes.

There is an expression to sum a list of numbers “:sum” so we just need to get a list of numbers. You might be able to use “join with” in the expression to make a list of all the prices from the list of legs. I’m worried that might produce a text list that you can’t do math on.

Maybe what you need is a search that returns the price field (a number) from all of the relevant legs, then that could be summed and stored in a “total price” field in the itinerary thing.

I’ve got the fields all as Number, and know how to use the SUM function, but can’t save the List of Quoted Legs (they are individually quoted) to the Main Quote.

Not on a desktop at the moment to see the editor or share a demo, but if I understand your situation correctly, you can achieve what you want by creating a state on some element to hold the temporary list of objects from which you can manipulate said data for calculations and/or write to the DB.

Yes but the problem is I still can’t manipulate the data and save the List of Quoted Legs to the DB under the Main Quote using a workflow. ?

Are you talking about two different but related goals?

  1. save a list of leg-quote-things in a field of type leg-quote (list=yes) in the itinerary-thing
  2. save a single number representing the sum of the price field from each of the leg-quote-things in that list

Since I have no idea on how you’ve structured your data and point of action for the data calculations, I’ll just leave some notes :

  • A button/workflow for storing temporary list of quotes in a state
  • A button/workflow for performing calculations on said temporary list and then storing the final value in another state
  • A button/workflow for updating the DB from the state’s list-values via the ‘make changes to a list of things’ function assuming you’ve already set the Itinerary object as a list of ‘quotes’ object

Good luck!

1 Like
  1. save a list of leg-quote-things in a field of type leg-quote (list=yes) in the itinerary-thing

Is correct and the main objective.

The final quote, like any receipt from a store, should have itemized ‘leg quotes’ within the main ‘quote’ Thing.

Heirarchy is a Flight Request contains multiple Quotes from different airlines. Each Quote is broken down into a list of Leg Quotes.

i just can’t create a Quote and Add the list of Leg Quotes to it.

From there, the SUM is easily achieved by searching for the leg quotes contained within the quote.

so do you have a flight-request-thing with a field list-of-quote-things
and then a quote-thing with a field list-of-leg-quote-things
and then a leg-quote-thing with a number-field “price”?

if not, how is your data organized?

See here:

Flight request contains a list of flight legs and also a list of quotes. This is generated by the user (aka a flight request).

Quotes contain the list of leg quotes:

Leg quotes contain the details of each leg, price for each flight leg etc:

The FLOW is the airline submits each flight leg quote individually, and then clicks ‘review’ to review and finalize the quote and total it up, and once he clicks ‘SUBMIT’ it should add all leg quotes to the master quote and send it off to the user.

The Quote should have a broken down list of the leg quotes on it for the user to view vs. one total sum.

Maybe you just need to use “add list” instead of “add”? Those expressions aren’t documented @emmanuel and I’m not entirely sure how they work.

Maybe you need some kind of “working” flag so you can search for all of the leg quotes this user has that haven’t been confirmed or deleted yet?

1 Like

Who knew this even existed!

My oversight after configuring 1000’s things per day… THX

And agreed, should be doc’d.

I’m also experiencing this problem, but I don’t quite get how ‘add list’ would work. Where would I need to use this expression?

“Add list” could be used instead of a loop function to schedule thins, I.e. Make a list of records based of specified conditions, for example, repeating events.