Get only the attachment.url value when using Rollup field to clone an Attachment field

I want to clone a field from Entity 1 to entity 2, usually this is trivial.

But the field is an attachment field, “cmsLogo”.

When I use values, it “works” but shows a weird formatted string.

I tried other options such as values.1 and values[1] but no luck.

Any idea how to get the url only?

Use SUBSTITUTE(RIGHT(ARRAYJOIN(values), LEN(ARRAYJOIN(values)) - 14), ')', '')

That “weird formatted string” is what an attachment field passes to a formula, including the formula in a rollup field. The values reference used by a rollup does refer to the array of collected items, but the array can only be processed using Airtable’s built-in array functions. In this case you’re getting a one-item string array.

It should be noted that the formula that @TFP wrote will only work as long as the filenames themselves maintain that same length (8 characters for the name, plus “.png”). If the filename length ever varies from that, you’ll have to tweak the formula.

1 Like

Indeed. Better use SUBSTITUTE(RIGHT(ARRAYJOIN(values), LEN(ARRAYJOIN(values)) - FIND('(', ARRAYJOIN(values))), ')', '')

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.