Displaying embedded images

Home Forums Advanced usage Displaying embedded images

This topic contains 4 replies, has 3 voices, and was last updated by  Noah Goodman 3 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #664

    Noah Goodman
    Participant

    I have been displaying a Tweet’s embedded image in one of the cells in my TAGS sheet using the following formula:

    =image(left(REGEXEXTRACT(R2, “media_url[[:punct:]]:[[:punct:]](.*?),”),LEN(REGEXEXTRACT(R2,”media_url[[:punct:]]:[[:punct:]](.*?),”))-1))

    It goes into the entities_str cell (R2 here) and pulls the url that follows the string media_url”:” and proceeds the next quotation mark.

    I know that someone with a better handle on RegEx could write a much cleaner function and was wondering if someone might be able to help.

    Thanks,
    Noah

    #665

    johnl
    Participant

    I haven’t looked too closely as the output, but this did seem to work.

    =image(iferror(REGEXEXTRACT(R2,”media_url.:.(http.*).,.media_url_”),””))

    #666

    Noah Goodman
    Participant

    Hey John,

    Thanks for your reply. I tried using that formula and I get an #ERROR!. Any ideas?

    Best,
    Noah

    #667

    mhawksey
    Keymaster

    Hi Noah,

    slight variation on johnl’s answer (you might need to adjust the Q2 – this assume entities_str is in column Q:

    =IMAGE(IFERROR(REGEXEXTRACT(Q2,"media_url.:.(http.*?).,"),""))

    … if you would like to apply this to a column insert a new column and in the header use (again assuming entities_str is in column Q)

    =ARRAYFORMULA(IMAGE(IFERROR(REGEXEXTRACT(Q:Q,"media_url.:.(http.*?).,"),"")))

    #668

    Noah Goodman
    Participant

    Works beautifully. Thanks Martin and John.

    Best,
    Noah

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.