Browse our comprehensive FAQ section to quickly find solutions, learn how to use ChatMaxima features, and get step-by-step guidance for setup, integrations, and support.
The Loop Over Items block allows your chatbot to repeat a set of actions for every item in a list or collection. It's a powerful tool for processing multiple pieces of data one by one.
It automates repetitive tasks. For example, if a user has a list of items in their shopping cart, the bot can use this block to check the stock for each item individually.
The "Enter Source" field is where you specify the list or collection of items you want the bot to go through. This source could be a variable containing an array of data, for example, from an API response.
This field is where you define a temporary variable that will hold the value of the current item as the bot loops through the list. This allows you to perform actions on each item one by one.
The "Enter Batch Size" field is used to set the number of items the bot should process at one time. This is useful for managing performance and preventing the bot from getting overwhelmed with very large lists.
You would place this block at the beginning of a sequence of actions you want to repeat. For example, you could have a "Loop Over Items" block that feeds into a "Text" block, and the "Text" block would display a different message for each item in the list.
The loop automatically continues until every item in the source list has been processed.
Once the bot has gone through every item in the list, the loop is complete, and the bot will proceed to the next block in the main conversation flow.
After filling in all the required fields, you must click submit to save the block and add it to your chatbot's workflow.
You can find the "Loop Over Items" block by navigating to Dashboard → Quick Access. Then, under ChatMaxima Studio, click on Create Chatbot. The block will be available in the sequence section of the builder.
You can find the video tutorial at:: https://chatmaxima.com/video-tutorials/creating-a-loop-items-node-in-chatmaxima/
By setting a batch size, you can prevent the bot from trying to process hundreds or thousands of items at once, which could slow down the system. It helps the bot handle large lists more efficiently.