I don't know the proper way to handle dynamic code with multipe values. Can someone help me?
This is the error I am facing when I use switch case in the delivery.
i have attached the code and th error screenshot below.
Views
Replies
Total Likes
Hello @Jayan_Sk
You can use the If else condition.
Here is an example:
<% if(targetData.productType=='cavity'){ %>
INCLUDE CAVITY VIEW HERE
<% } if(targetData.productType=='PRODUCT_2'){ %>
INCLUDE PRODUCT 2 VIew HERE
<% } %>
This one is working. But I have 4 cases so I thought of using switch case.
Views
Replies
Total Likes
Hello @Jayan_Sk ,
Maybe you can try apart from IF that worked:
targetData.productType.toString()
<%
var viewName = ""
switch(targetData.productType.toString()){
case "whitening":
viewName = "orn_VIEW84"
break;
case "sensitive":
viewName = "orn_VIEW114"
break;
}
%>
<%@ inlcude view={viewName} %>
Marcel Szimonisz
MarTech Consultant
for more tips visit my blog
https://www.martechnotes.com/
Tried this Code, this is the error I'm getting.
Views
Replies
Total Likes
Can you look up delivery and screenshot error from dashboard?
Views
Replies
Total Likes
Hi @Jayan_Sk,
Were you able to resolve this query with the help of the given solutions or do you still need help here? Do let us know.
Thanks!
Views
Replies
Total Likes