Creating a list

If we want to use a few of our favorite things in a flow, we can create values representing each of those things. Or.. We can create a type.. and a single list value of that type that holds the entire list.

One of the advantages of creating a type and a list is how fast we can edit the data. Say, we have a production app that lists the insurance policies of 75,000 members. If we need to add a data field, we can just add a new property in the type, instead of editing the 75,000 member data one by one.

Let’s build a list now!
  1. Click LOG IN to log in to the Flow Drawing Tool.
  2. Create a new Type. Let’s say, Monsters.
  3. Let’s give our Monsters a few properties.
  4. What is better than a type called Monsters? A list of the Monsters type! Let’s create it then. Click Values.
  5. Click New Value.
  6. What kind of list are we creating? A list of monsters, of course. Copy-paste List of monsters in the Name field.
  7. Select List as the kind of value. This opens the option for selecting a type of value.
  8. Click Select a Type.
  9. Search for and select Monster.

    This is what the screen looks like now:
  10. We know that an instance of a type is an object. And a collection of objects is a list. What we did just now is create an empty list, of the Monster type. We can now save the value, and populate the list at a later time (say, from user input). We can also add default data at this stage. Let’s try that.
  11. Click the + icon. This expands the options for adding default object data.
  12. Copy-paste Inverness in the Home town, Ms. Nessie in the Name, 1 in the Number of heads4 in the Number of limbs, and 17.29 in the Scariness quotient fields  respectively.
  13. Click the + icon again. This is our second monster object..  Home town – Odenwald, Name – Frankie, Number of heads – 1,  Number of limbs – 4, and Scariness quotient – 11.07.

    Perhaps you would like to create your own monster object, based on the above template? Go on, create a few objects.
  14. Click Save Value when done. This saves the List of monsters value.

And we are all set! The list is ready to be used in a flow now.

Here are some other cool things to do: