Last active
August 22, 2016 21:43
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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