TagUI
TagUI copied to clipboard
Unable to use braces when calling a TagUI Workflow inside another script - use indentation instead of curly braces
I am receiving the error below when I am trying to call another tagui script within the flow where I have a for loop.
ERROR - number of step { does not tally with with }
ERROR - automation aborted due to above
e.g. child.tag
echo hello
parent.tag
tagui child.tag
for n from 1 to 5
{
echo n
}
Hi @chialiyun you can use indentations instead of using braces
tagui child.tag
for n from 1 to 5
echo n
https://tagui.readthedocs.io/en/latest/main_concepts.html#for-loops
@ruthtxh it did not work for me.
here's my code: child.tag
UrlDict = {}
csv_file = 'file.csv'
load `csv_file` to lines
array_lines = lines.split('\n')
for (n=1; n<array_lines.length; n++)
items = array_lines[n].split(',')
country = items[0].trim()
UrlDict[country] = items[4].trim()
url = UrlDict[p1]
echo `url`
parent.tag
tagui child.tag
echo selected `UrlDict['sg']`
for n from 1 to 4
echo n
@ruthtxh it did not work for me.
here's my code: child.tag
UrlDict = {} csv_file = 'file.csv' load `csv_file` to lines array_lines = lines.split('\n') for (n=1; n<array_lines.length; n++) items = array_lines[n].split(',') country = items[0].trim() UrlDict[country] = items[4].trim() url = UrlDict[p1] echo `url`
parent.tag
tagui child.tag echo selected `UrlDict['sg']` for n from 1 to 4 echo n
hi chialiyun,
when the csv content contains "\n",
#,firstname,lastname
1,tony,stark
2,bruce,wayne
3,peter,parker
4,"Dr
Steve",Strange
how to do it...?
Closing but please ping back if this is still relevant of an issue.