Create HTML Content - How to insert the image whose location is a variable?

Hi everyone,

I’m trying to insert a few screenshots using send outlook activity, I am using the Create HTML Content activity to format the HTML for the email body, the locations of the images are variables.

I tried in the Edit HTML Content activity - insert image - From file when run, it is giving me error as “Error: System.Exception: Object reference not set to an instance of an object”.

This variable is not Null, I tried String type variable which is the location of the image, also I tried a image type variable, none of them work.

Image type variable:

String type variable:

Variables:

Load image tp create Image type variable:

Thanks!

Hi @Lin_Lam

Did you tried creating a variable and then assign value to that variable.

Thanks

@ Rahul_Unnikrishnan

Yes, I did, please see the following screenshot:

Can you please share your xaml file if you don’t see such error message?

Thanks!

@Lin_Lam

Did you try adding it as a data value?

And alternately

Click on </> and then try inserting the code for image withh below method

Cheers

@Anil_G Do you mean by this?

I can’t leave it as hard coded - “text.png” since the location of the image is a variable.

I am not able to add variable in the HTML editor, can you please send me an example XAML?

Thanks!

@Lin_Lam

Try modifying like this

Cheers<IMG src=" &amp; variablename &amp; "/>

Cheers

It doesn’t work, the email is still showing “no image error”

Here is what I configured, I tried two different tags, none of them worked:

@Lin_Lam

Did you attach the email as well?

You have to attach and then give in the img tag

Cheers

I just tried, didn’t work.

Would you mind sending me an example XAML? I’m really struggling here…

Thanks a lot.

Hi , Any luck in finding solution … even I’m stuck with same issue.
@Anil_G any leads on sending a sample xaml with create html content activity please