I have 3 images (imagine: logo, img1, img2) uploaded and published in Content Builder.

I want to add thos published URLs to a DE, so in logo's line I add url from logo image.

If there a just 3, its easy to do it manually but thinking of more images, I would like to know I there is a way to automate it and have all urls stored automatically in a DE with the name of the image.

  • 3
    Welcome to SFSE, Constanza. Can you explain in more details what you are trying to achieve? A single sentence in your question does not provide a lot of context, and hence makes it extremely difficult to help you. Mar 22, 2022 at 13:34

1 Answer 1


I will recommend using Ampscript's contentimagebykey function. You should apply unique and logical keys to your images, e.g. "logo_brandX", "logo_brandY". This will let you use an ampscript parameter to fetch the right logo.

You can use it in following way, assuming you are setting the image based on a value in sendable data extension (let's call it brand):

SET @brand = AttributeValue("brand")
SET @imagekey = Concat("logo_",@brand)

Here goes the image:<br/>

As an example, I have created an image here, which is uploaded and once uploaded, I have updated the key to logo_audi:

enter image description here

Then, according to the amscript code above, I would have a value of audi in my record in sendable data extension, then this value would be combined with logo_ in the Concat function, allowing logo_audi to be displayed by ContentImageByKey.

A good practice would also be to add a default logo, if there is a recipient with a brand which doesn't match any uploaded images. It will then be displayed instead.

See this answer on how to manage additional parameters in the img tag when using this function.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .