Skip to content

Instantly share code, notes, and snippets.

@bmcbride
Last active August 22, 2016 21:43
Show Gist options
  • Save bmcbride/149c05758fcca2a43fa0ade639ba6faa to your computer and use it in GitHub Desktop.
Save bmcbride/149c05758fcca2a43fa0ade639ba6faa to your computer and use it in GitHub Desktop.
Get a direct link to the thumbnail of the first image in a photo field with Fulcrum data shares. Useful for pulling an image into a CartoDB image header info window.
SELECT *, CASE WHEN photos != '' THEN left(photos_url, position('/view' in photos_url)) || split_part(photos, ',', 1) || '/thumbnail.jpg' ELSE photos END AS thumbnail FROM my_fulcrum_table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment