Iterators

Fieldset Iterator

Fieldset iterators are used in cases where you need to have several sets of fields pre-set. This iterator can contain a list of sets of fields, on which the digger will be iterated. The following parameters are used to initialize the iterator:

Parameter Description
type Constant, defining iterator type, has value fieldset.
fields List of fieldsets. Every field in fieldset should be set as field_name: field_value.

The following is an example of initializing an iterator:

              iterator:
- type: fieldset
  # LIST OF FIELDSETS
  fields:
  # FIRST FIELDSET
  - name: joe
    surname: doe
  # SECOND FIELDSET
  - name: mary
    surname: smith
              

As result we get the following list of argument sets. And digger will execute the main logical block for each element of this list:

              [
    { "name": "joe", "surname": "doe" },
    { "name": "mary", "surname": "smith" }
]
              

We hope that now you understand how iterators works and what problems they solve :)
So we can go to the basic logic block of the digger and the methods that you can use there.