Hi Team
I have a use case where
Schema Recipient has a attribute named JsonResponse (example below)
{
"employee": {
"name": "sonoo",
"salary": 56000,
"age": 30
}
}
I want to call employee.name directly within delivery without using JS activity in between, how can I achieve it ?
Solution I tried:
1. Created a workflow with JsonResponse as additional data
2. Inside delivery activity, I have added following
<% var test= JSON.parse(targetData.JsonResponse );
%>
Employee Name is : <%= test.employee.name%>
This way I am getting following error
Error while compiling script 'content htmlContent' line 5: #DOMAIN#. SCR-#ID# Javascript: error while evaluating script 'content htmlContent'.
Can someone help with this ?
Thanks
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi Manoj
This is resolved, issue was with the memo data type.
Thanks
Views
Replies
Total Likes
Hello @Maverick2494
I am assuming the data type of column JsonResponse is astring. If not then use can convert to it a string using toString() function.
Then do this:
<%
var employee=targetData.JsonResponse.split('"');
var employeeName=employee[5];
%>
Employee Name is <%= employeeName %>
Thanks for looking in to this @_Manoj_Kumar_
The field I am using is of type long text field.
Ex. mEmployee not sEmployee.
I tried above approach getting similar error.
Tried doing toString as well.
It says undefined.
do you think data type long text field can be the reason of failure ?
Thanks
Views
Replies
Total Likes
Hello @ketananxi123
It should work the same way for the memo field as well.
Could you please share the code you tried?
Views
Replies
Total Likes
Hi Manoj
This is resolved, issue was with the memo data type.
Thanks
Views
Replies
Total Likes
Hi @Maverick2494,
Were you able to resolve this query or do you still need help here? Do let us know.
Thanks!
Views
Replies
Total Likes
Hi Sukrity
This is resolved, issue was with the memo data type.
Thanks
Thanks for sharing the update!
Views
Replies
Total Likes
Views
Likes
Replies