**SPIP**
# Article submitted
The article "**The DATA loop**
(https://www.spip.net/ecrire/?exec=article&id_article=6575)" is submitted
for publication. on Friday 29 May 2020.
* * *
## The DATA loop
Friday 29 May 2020 , by [jack](.././?page=auteur&id_auteur=593&)
The DATA loop is able to iterate on a set of `data` of a certain `format`.
Its syntax is as follows:
<BOUCLE_display
(DATA)
{source format,data}
>
[
(
#CLE
)
]
-
[
(
#VALEUR
)
]
</BOUCLE_display>
The criterion `{source format, data}` defines the data on which the loop
will iterate.
— **The `format`** can be of this type:
- PHP array: `table|array`
- Local file collections: `ls|preg_files`
- File contents (local or remote): `file|csv|json|xml|rss|yaml|...`
- Commands: `sql|yql|ics|liste|enum|plugins|...`
— **The `data`** can be of several kinds, depending on the format :
- a PHP array
- the path of a file or folder on the hard disk</code>
- the URL of a file or a webservice (API)</code>
- or any string that the format will be able to transform into a data
table, ex: `"select * from flickr.photos.search where text='spip'"`
The following criteria are used to filter the tables displayed by the DATA
loops.
- `{value=x}` ; the available operators are `=, >, <, >=, <=, ==`(rational
expression) and `LIKE`.
- `{par xx}` and `{!par xx}`
- `{a,b}` et `{pagination ...}`
- `{fusion /x/y}`
- `{datapath path/to/my/data}`
A complete chapter details the usage of DATA loops, provides usage examples
and presents how to declare new DATA loops.
**Read more** : Iterators for SPIP - the (DATA) loop
(https://www.spip.net/ecrire/?exec=article&id_article=6486).
— Sent by SPIP (https://www.spip.net/)

![]()