rapid-king-38539
02/16/2022, 10:20 PMfor
loop to do this, because AFAIK there isn't another way to insert an arbitrary number of spaces. Unfortunately, some sort of optimization seems to be taking place, because {% for i in (1..spaces_needed) %} {% endfor %}
or {% for i in (1..spaces_needed) %}{{' '}}{% endfor %}
result in just one space, but {% for i in (1..spaces_needed) %}x{% endfor %}
results in spaces_needed
copies of x
. Is this a bug in Tines? In Liquid? In my code?rapid-king-38539
02/16/2022, 10:39 PM*
instead, and then doing a replace: "*", " "
also optimizes away sequential spaces.adorable-photographer-66555
modern-farmer-99434
modern-farmer-99434
modern-farmer-99434
modern-farmer-99434
{
"agents": [
{
"disabled": false,
"name": "List",
"options": "{\"mode\":\"message_only\",\"loop\":false,\"payload\":[\"dog\",\"cat\",\"mouse\"]}",
"position": {
"x": 945,
"y": 285
},
"type": "eventTransformation"
},
{
"disabled": false,
"name": "set message with xyz",
"options": "{\"mode\":\"message_only\",\"loop\":false,\"payload\":{\"message\":\"x{%for item in list%}xyz{%endfor%}x\"}}",
"position": {
"x": 945,
"y": 405
},
"type": "eventTransformation"
},
{
"disabled": false,
"name": "replace xyz",
"options": "{\"mode\":\"message_only\",\"loop\":false,\"payload\":{\"message\":\"{{set_message_with_xyz.message | replace:'xyz', ' '}}\"}}",
"position": {
"x": 945,
"y": 540
},
"type": "eventTransformation"
},
{
"disabled": false,
"name": "List",
"options": "{\"mode\":\"message_only\",\"loop\":false,\"payload\":[\"dog\",\"cat\",\"mouse\"]}",
"position": {
"x": 1170,
"y": 285
},
"type": "eventTransformation"
},
{
"disabled": false,
"name": "set message with x",
"options": "{\"mode\":\"message_only\",\"loop\":false,\"payload\":{\"message\":\"x{%for item in list%} x {%endfor%}x\"}}",
"position": {
"x": 1170,
"y": 405
},
"type": "eventTransformation"
}
],
"links": [
{
"sourceIdentifier": 0,
"receiverIdentifier": 1
},
{
"sourceIdentifier": 1,
"receiverIdentifier": 2
},
{
"sourceIdentifier": 3,
"receiverIdentifier": 4
}
],
"diagramNotes": []
}
the first is doing a forloop with xyz then replacing xyz
with three blank spaces; the next is including an x
in the centremodern-farmer-99434
rapid-king-38539
02/17/2022, 7:10 PMreplace
rapid-king-38539
02/17/2022, 7:10 PM*
instead of spaces, and then piped it through replace: "*"," "
and that also stripped all but one space.rapid-king-38539
02/17/2022, 7:11 PMmodern-farmer-99434
modern-farmer-99434
rapid-king-38539
02/17/2022, 7:13 PMmessage only
actionrapid-king-38539
02/17/2022, 7:13 PMmodern-farmer-99434
modern-farmer-99434
rapid-king-38539
02/17/2022, 7:20 PMmodern-farmer-99434
rapid-king-38539
02/17/2022, 7:24 PMrapid-king-38539
02/17/2022, 7:25 PMfor
loop output, I would expect a replace
operation to work normally, but I can't seem to replace with just spaces, either.rapid-king-38539
02/17/2022, 7:26 PM*
inside my for
loops, then a replace
operation worked to change them to spaces. It didn't yesterday. Baffled but my problem is resolved.modern-farmer-99434
modern-farmer-99434
modern-farmer-99434
modern-farmer-99434
rapid-king-38539
02/17/2022, 7:30 PMrapid-king-38539
02/17/2022, 7:36 PMmodern-farmer-99434
rapid-king-38539
02/17/2022, 7:37 PM