IDEMSInternational / rapidpro-flow-toolkit

Toolkit for using spreadsheets to create and modify RapidPro flows
GNU Lesser General Public License v2.1
3 stars 1 forks source link

Tags for content index #86

Closed geoo89 closed 1 year ago

geoo89 commented 1 year ago

Each row of the content index may now contain a list of tags. main.py takes an optional argument --tags specifying tags to filter the rows of the content index by. This argument is a sequence of lists, each list starting with an integer indicating the index of the tag, followed by tags to filter by for this index. If a tag in the content index is empty, is it considered to be matching. For a row to be processed, the tags need to match for ALL of the specified indices.

Example: Take a look at tests/input/example1/content_index.csv If we supply --tags 1 advanced basic 2 type1 to main.py it means: Only process rows of the content index where the first tag (tags.1) is either ‘advanced’, ‘basic’ or empty, and where the second tag (tags.1) is either ‘type1’ or empty.

You can try this out via main.py create_flows tests/input/example1/content_index.csv out.json --format=csv --datamodels=tests.input.example1.nestedmodel --tags 1 advanced basic 2 type1