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
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Level 1
Probal_Ray
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
Probal_Ray
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
Probal_Ray
Level 1

19-09-2018

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.

Accepted Solutions (0)

Answers (0)