Creating dynamic content rule in delivery with first name > 2 characters | Community
Skip to main content
New Participant
Nov 18, 2020 3:12 PM UTC
Question

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

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

12 replies

Sukrity_Wadhwa
Employee
Dec 7, 2020 10:48 AM UTC

Hi @george-ct5,

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

Thanks!

Translate
Sukrity Wadhwa
New Participant
Dec 7, 2020 10:50 AM UTC
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.
Translate
shelly-goel
Employee
Nov 21, 2020 9:40 PM UTC

@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.

 

Translate
New Participant
Nov 24, 2020 1:58 PM UTC

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?

Translate
Level 3
Nov 21, 2020 3:07 PM UTC

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 :

 

 

 

Hope this is clear enough.

 

Translate