This article will teach you about the List blocks in our Dynamic Engine.
The List Blocks
There are 12 kinds of list blocks you can use in the Dynamic Engine. This article focuses on the following 3 core blocks:
- Create List With
- Make List From Text
- In List Get
List Block: Create List With
The create list with block assigns a list of values to your variable. This allows you to group items together while also maintaining their independence from one another.
For example, this sets the value of the variable named "List of Colors" to "Red,Blue,Green,Yellow". The colors are separated by a comma when stored in the Dynamic Engine.
List Block: Make List From Text
The make list from text block does the same thing as the create list with block. It works great when you have a really large list that you want to add to the dynamic engine because it saves time by not having to drag and drop blocks.
For example, this sets the value of the variable named "List of Colors" to "Red,Blue,Green,Yellow" (same as above).
For example, this sets the value of the variable named "List of Colors" to "Red,Blue,Green,Yellow" (same as above).
The colors are separated by a comma when stored in the Dynamic Engine. The most common delimiter that people use with computers is a comma. We blew our intern's mind when we showed them that .csv files from excel stand for Comma Separated Values 🤯
Note that there are no spaces when using the delimiter, unless you specify the delimiter to have a space.
Note that there are no spaces when using the delimiter, unless you specify the delimiter to have a space.
List Block: In List Get
The in list get block lets you pull a value out of the list. This is useful when you want to pull a random value from a list. For example, this sets the value of the variable named "Random Color" to either "Red", "Blue", "Green" or "Yellow".
The way this works is we first want to create a list. In this case, the list is called "List of Colors". Then, we want to create a new variable called "Random Color" that uses the in list get block from, and specify that we want a random value from the list.
The options for the get dropdown do the following:
The options for the get dropdown do the following:
- Get - gets a value from the list, leaving the list unchanged
- Get and Remove - gets a value from the list, removes it and updates the list
- Remove - removes a value from the list and updates the list
For example, the following blocks could result in the variable "Random Color" being "Green" and the list becoming "Red,Blue,Yellow".
The options for the # dropdown do the following:
- # - gets a value from a specific position in the list (e.g., the 2nd value would be "Blue")
- # from end - gets a value from a specific position in the list, counting from the end
- First - gets the first value in the list
- Last - gets the last value in the list
- Random - gets a random value in the list
Example Question Using Lists Blocks (Beginner Level)
Consider the following Multiple Choice question in EXAMIND.
The goal of this question is to add a custom list of long-term assets can current assets.
Here is what the Dynamic Engine would look like:
Here is what the Dynamic Engine would look like:
What's happening here is that we are using the create list with block to generate a list of values and the in list get block to assign a random value to the variable "long-term-asset" and Current Asset 1 and Current Asset 2.