Removing context from attachments when extracting urls

So I use airtable to organize content for my websites and it’s been great. I initially started using it to create a web archive for a artist syndicate that needed a place to put up all their media, which is where I first encountered this issue. When uploading to wordpress using WP All Import Pro I need to have a bare url, but airtable dumps context into the field when you query the url. I was able to get around this using a regular expression to search for the beginning of the actual url and exclude everything before and ignore special characters. That worked fine considering that I only needed 1 attachment per post.

Well now, I’m doing something similar to my own photo/video site and have created a portfolio post type where I can upload multiple photos into a gallery for each post. Thus I have multiple attachments per record in airtable, which the regular expression does not work with since there are multiple urls.

So my question is how can I get airtable to spit out a completely bare comma-separated list of attachment urls with 0 context.

Welcome to the community, @Dennis_Layden.

There are several different ways of doing this. If you’re going to be having a varying amount of attachments in your attachment field, then your solution needs to be as robust & flexible as possible.

In my personal opinion, the absolute easiest & most foolproof & most flexible way of doing this is to use Integromat, which has full Airtable & Wordpress support.

You can set it to iterate through each of the individual attachments in your attachment field and then extract the URLs themselves (without any additional context) for uploading to Wordpress… or uploading to anywhere else, for that matter.

So you could just create a CSV file if you wanted, or do whatever you want with the URLs. You could even add other Airtable fields as well… your imagination is the limit for what you can do with Integromat.

You could even send the bare URLs back to Airtable to create individual records in their own table, and then manually export your CSV instead of automatically creating a CSV via Integromat. You can really do anything you want.

You should be able to figure it out on your own, but if you’d like to hire an expert Airtable consultant & expert Integromat Partner to help, feel free to contact me through my website at scottworld.com.

Thanks for the help! I was able to achieve success using Integromat, even though I’m not sure it’s the best “scenario.” Here’s what I ended up doing:

I’m watching the table for new data based on recently updates, used the iterator to break the attachments array down, used the text aggregator to add a comma and a space for each item in the array, and then passed all of that to a new text field I created in Airtable

image

1 Like

That’s fantastic! Great job! It’s the “best” scenario if it works perfectly for you! :cowboy_hat_face: :horse_racing: :raised_hands:

1 Like

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