Richard Quintana
Richard Quintana

Reputation: 29

I would like to split multiple URLs from a single Google Sheets cell and then add them as images into a Google Doc

I have a Google Sheet doc that has column called Imgs which contains a cell with multiple URLs that links to multiple images:

enter image description here

So, I would like to do the following with an Apps Script:

  1. Split the URLs by eliminating the comma delimitator

  2. Find a way to create an array with each URL

  3. Pick URL by URL from the array and then attach each one to the Google Doc as images, leaving something like this

Here's the link to the Google Sheet as an example: link

Any help would be appreciated!

Upvotes: 0

Views: 1016

Answers (1)

JohnA
JohnA

Reputation: 1107

Without your specific sheet I made a similar one

enter image description here

E9 has a long string of URLs

'https://www.agustafamily.net/Hayden.png,https://www.agustafamily.net/wedding.jpg

Using the SPLIT function returns individual URLS

=SPLIT(E9,",")

The using the IMAGE() function to get the images

=image(E10)

Upvotes: 1

Related Questions