Forum Discussion
DonLarson
3 years agoQrew Elite
Prashant,
I am close on the Pipeline but do not really understand it. I have figured out where my issue is.
I created a text field of the Reference Fields in my Quick Fill
[3;5;6;4;7] these are the RIDs of my Items selected.
The split is producing a JSON list
{ 1 3
2 5
3 6
4 4
5 7}
when the loop tries to write that to the Related Item it is incompatible. I found that out by writing to a text field instead of the Related Item field.
I assume that {{x|trim}} is meant to remove the index value but it is coming through.
------------------------------
Don Larson
------------------------------
I am close on the Pipeline but do not really understand it. I have figured out where my issue is.
I created a text field of the Reference Fields in my Quick Fill
[3;5;6;4;7] these are the RIDs of my Items selected.
The split is producing a JSON list
{ 1 3
2 5
3 6
4 4
5 7}
when the loop tries to write that to the Related Item it is incompatible. I found that out by writing to a text field instead of the Related Item field.
I assume that {{x|trim}} is meant to remove the index value but it is coming through.
------------------------------
Don Larson
------------------------------
PrashantMaheshw
3 years agoQrew Captain
HI Don,
Thanks for taking time to post !
Trim in earlier example was supposed to
1. In Loop condition help with finding and skipping blank rows as users were simply typing whatever they wished
2. Trim any extra spaces
My two immediate question would be
1. Have you changed the delimiter from \n to ;
2. Is there any extra space when feeding any record id# to new table. "{{x}}" is different from "{{x}} "
In this example since items are selected from dropdown , that wouldn't be the case , we can still use it in our loop for failsafe
BUT below will also work
You can post your code you are running and we can troubleshoot
------------------------------
Prashant Maheshwari
------------------------------
Thanks for taking time to post !
Trim in earlier example was supposed to
1. In Loop condition help with finding and skipping blank rows as users were simply typing whatever they wished
2. Trim any extra spaces
My two immediate question would be
1. Have you changed the delimiter from \n to ;
2. Is there any extra space when feeding any record id# to new table. "{{x}}" is different from "{{x}} "
In this example since items are selected from dropdown , that wouldn't be the case , we can still use it in our loop for failsafe
{%- set plist = a.multi_ingredients.split(';') -%}
{
"to": "bsvit786z",
"data": [
{%- for x in plist if x|trim != '' %}
{
"9": { "value": "{{a.id}}" },
"14": { "value": "{{x}}" }
}{{ ',' if not loop.last }}
{%- endfor %}
]
}
BUT below will also work
{%- set plist = a.multi_ingredients.split(';') -%}
{
"to": "bsvit786z",
"data": [
{%- for x in plist %}
{
"9": { "value": "{{a.id}}" },
"14": { "value": "{{x}}" }
}{{ ',' if not loop.last }}
{%- endfor %}
]
}
You can post your code you are running and we can troubleshoot
------------------------------
Prashant Maheshwari
------------------------------