Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

ACS : How to access a custom resource field inside a content block

Avatar

Level 1

Hi,

      I have created a content block which will display a custom resource field and i am making it dynamic by using Java Script. As we know we can access an OOTB field for example firstName from Profile as:

var firstName = context.profile.firstName ;

But how to access a custom resource field in the similar way.

For my use case i want to access a field named 'price' from a custom resource say 'productLookUp':

I am using the following code:

var price= context.targetData.cusProductLookUp.price;

But when i am using the above content block in an Email Delivery i am getting the following :

JST-310000 Error while compiling script 'sampleDeliveryTemplate[htmldefaultContent]' line 86: context.targetData is undefined.

so it is not able to compile the above line of code. Can you please suggest any alternative way to achieve the same.

0 Replies