Hi,
you can apply ‘low-code’ approach. to get last element of array, use method ‘pop’.
between trigger and ‘create record’, install simple script step.
You should pass this array, as input parameter with any name (I used ‘urls’)
input parameters located in ‘input.config()’
then you should pass output element, assigning it to some variable. you can use this variable in next steps.
so:
const single=input.config().urls.pop();
output.set(‘url’,single);
that’s how similar setup looks like:

after that, use this variable ‘url’ in further steps, as you usually do with values.
Actually, you can do the same without code by creating additional mini-table with extracting last url from array, by text formulas, and then at next step take your value. But I think solution without extra table is better.
Hi,
you can apply ‘low-code’ approach. to get last element of array, use method ‘pop’.
between trigger and ‘create record’, install simple script step.
You should pass this array, as input parameter with any name (I used ‘urls’)
input parameters located in ‘input.config()’
then you should pass output element, assigning it to some variable. you can use this variable in next steps.
so:
const single=input.config().urls.pop();
output.set(‘url’,single);
that’s how similar setup looks like:

after that, use this variable ‘url’ in further steps, as you usually do with values.
Actually, you can do the same without code by creating additional mini-table with extracting last url from array, by text formulas, and then at next step take your value. But I think solution without extra table is better.
Keep in mind that this method of extracting urls using a formula field will likely break in November when urls of attachments undergo a change.
Keep in mind that this method of extracting urls using a formula field will likely break in November when urls of attachments undergo a change.
Yes, you are right, it probably break, But I think that’s the least of concern with November change. I think, significant part of such scripts/automations will lose their sense of existence. Some customers even can decide to change platform. Unless there will some simple and obvious way, to preserve their valuable documents, on the moment of change and later. I mean obvious for management squad, with 'User"/“Power user” level of understanding tech side.
Hi,
you can apply ‘low-code’ approach. to get last element of array, use method ‘pop’.
between trigger and ‘create record’, install simple script step.
You should pass this array, as input parameter with any name (I used ‘urls’)
input parameters located in ‘input.config()’
then you should pass output element, assigning it to some variable. you can use this variable in next steps.
so:
const single=input.config().urls.pop();
output.set(‘url’,single);
that’s how similar setup looks like:

after that, use this variable ‘url’ in further steps, as you usually do with values.
Actually, you can do the same without code by creating additional mini-table with extracting last url from array, by text formulas, and then at next step take your value. But I think solution without extra table is better.
Hi Alexey,
Thank you so much for providing this solution. Worked like a charm.