Contact Us

March 24, 2024

May 15, 2026 9:06 am

Displaying dynamic product images and prices in Agentforce

Share with

Understanding the Issue

The community member has updated the instruction to render a static image using Markdown syntax, which works correctly. However, the dynamic image from the response does not render. This suggests that the issue lies in the way the dynamic image is being referenced in the Agentforce output.

Root Cause of the Issue

The root cause of the issue is that the instructions are not properly handling the dynamic image URLs returned in the OCAPI response. The COMMERCE_SHOPPER_COPILOT_B2C__GetB2CProductRecommendations response contains the correct image URLs, but the Agentforce output is not rendering them correctly.

Fixing the Issue

To fix the issue, the instructions need to be rewritten to support dynamic images. This can be done by parsing the product list from the COMMERCE_SHOPPER_COPILOT_B2C__GetB2CProductRecommendations response and using the correct Markdown syntax to render the dynamic images.

example.md

![Product Image]({{hits[].c_imageUrl}})

Additionally, the price can be displayed using the hits[].c_customPrice and hits[].c_currencySymbol fields.

Heads up: Make sure to test the rewritten instructions thoroughly to ensure that the dynamic images and prices are rendering correctly in Agentforce.

Checklist for Implementing the Fix

  • Parse the product list from the COMMERCE_SHOPPER_COPILOT_B2C__GetB2CProductRecommendations response
  • Use the correct Markdown syntax to render the dynamic images
  • Display the price using the hits[].c_customPrice and hits[].c_currencySymbol fields
  • Test the rewritten instructions thoroughly
  • Verify that the dynamic images and prices are rendering correctly in Agentforce

Frequently Asked Questions

What is the correct Markdown syntax for rendering dynamic images?

The correct Markdown syntax for rendering dynamic images is ![Product Image]({{hits[].c_imageUrl}}).

How do I display the price using the hits[].c_customPrice and hits[].c_currencySymbol fields?

You can display the price by using the syntax {{hits[].c_customPrice}} {{hits[].c_currencySymbol}}.

What if the dynamic image is not rendering correctly in Agentforce?

If the dynamic image is not rendering correctly, check that the image URL is correct and that the Markdown syntax is being used correctly.

Can I use static images instead of dynamic images?

Yes, you can use static images instead of dynamic images, but you will need to update the instructions to reference the static image URLs.

Genetrix Technology · Salesforce Marketing Cloud Partner

Need help shipping this in production?

Genetrix builds and untangles Salesforce Marketing Cloud and Agentforce setups for teams that want it done right the first time. If anything in this post sounds familiar, talk to us before it ships.

Get in Touch with Genetrix →

Blogs for the

Business-Savvy!​

Let’s Connect

A 30 min no cost strategy session
with cloud support expert

Let’s Connect

A 30 min no cost strategy session
with cloud support expert