Expand my Community achievements bar.

We are excited to introduce our latest innovation to enhance the Adobe Campaign user experience — the Adobe Campaign v8 Web User Interface!

Creating dynamic content rule in delivery with first name > 2 characters

Avatar

Level 1

Hi all,

 

I'm looking to create a dynamic content rule targeting those who have a first name that is more than characters long.

 

I have done this in JavaScript in a segmentation node to give them a separate delivery, but I want to do it within the same delivery.

 

JavaScript used in segmentation node: Length(@firstName)>2

 

Does anyone know how to apply this rule within delivery dynamic content?

 

Thanks,

George

12 Replies

Avatar

Level 3

Hello @George-CT5,

 

There are two ways to do this depending on your end goal :

 

  • If the difference in content is just a greeting sentence you may want to use a content block and do your JS conditions in it directly.

 

  • If the content difference is significant you should go with dynamic content directly in your delivery by leveraging the segment codes in your split activity :

anasso83525035_0-1605970554445.png

anasso83525035_1-1605970675587.png

anasso83525035_2-1605970736257.png

 

anasso83525035_3-1605970787237.png

 

anasso83525035_4-1605970835675.png

 

Hope this is clear enough.

 

Avatar

Employee Advisor

@George-CT5

There's also a possibility to use advanced mode in dynamic condition where you can enter the length condition (as not available in basic mode) like context.profile.firstName.length > 2. If you have simple content display condition based on length you might also want to try out with "Visibility Condition". Refer this for detailed steps.

shelly-goel_0-1605994669749.png

 

Avatar

Level 1

Hi Shelly, the rule seems to have worked, but it also displays a lot of code above the fragment that has the dynamic rule. Image attached. Do you know how this can be deleted?First name dynamic content error.PNG

Avatar

Employee Advisor
Screenshot would definitely help to understand the issue better, you might not be able to add it while adding the comment but you can edit the comment and then add it. You might want to look at the source in the designer and try removing the extra code from there

Avatar

Level 1
Thanks Shelly. I have updated my previous comment.

Avatar

Employee Advisor
This looks like some syntax error in content (missing open or close tag). You can click on <> to see source and check the syntax. Does it go away if you remove the advanced condition?

Avatar

Level 1
Hi Shelly, no the error still stays there now. I'm assuming this is because it doesn't understand the advanced method.

Avatar

Employee Advisor
I don't think it's related to advanced mode. It this text stays after removing the advanced condition, it could be something else. From the image it looks like you've combined the length > 2 with !== '' which seems to be creating the issue.

Avatar

Administrator

Hi @George-CT5,

Were you able to resolve this query or do you still need more help here? Do let us know.

Thanks!



Sukrity Wadhwa

Avatar

Level 1
The answers provided haven't helped me resolve the issue, but I'm happy to leave this question and continue using the way we used before as we know this works. Thanks.