Photo Gallery Formatter

Hi All,

I’m trying to add headshots to Loan Officer entities in my experience. All of the headshots are currently stored in the Photo Gallery field. I’ve been following the instructions in the Defining New Cards training module, but don’t see a formatter for the Photo Gallery.

I’ve tried a number of snippets (few listed below) but images are not appearing in the experience. What is the correct photoGallery formatter we should be using?

image: profile.photoGallery ? Formatter.image(profile.photoGallery).url : null,
image: profile.photoGallery ? Formatter.image(profile.photoGallery[0]).image : null,
image: profile.photoGallery ? Formatter.image(profile.photoGallery).image : null,

Thank you,
Austin

Hi Austin,

Try the below:

image: profile.c_testGallery ? Formatter.image(profile.c_testGallery[0].url) : null,

The Formatter accepts an image URL. You’re accessing the first object of the list ([0]), and passing its URL parameter to the function - this is why it needs to stay in the parentheses.

Let me know if that works!

Circling back here as I tried the code above and it did not solve the error. I believe the code should read

image: profile.photoGallery ? Formatter.image(profile.photoGallery[0]).url : null,