Expand my Community achievements bar.

SOLVED

In data prep do we have any function using which we can check length of input string

Avatar

Level 2

In data prep do we have any function using which we can check length of input string.And if so which function also how can we ensure only if suppose length of that string is 5 for eg then only it gets ingested to AEP.

1 Accepted Solution

Avatar

Correct answer by
Level 1

@arijitg - I can confirm that <field>.length() will work in Data Prep mapping rules, though it doesn't seem to be documented in the online Data Prep mapping functions documentation (https://experienceleague.adobe.com/docs/experience-platform/data-prep/functions.html?lang=en). 

 

How did you come to learn about this function?  I wonder if there are other functions that could be useful - can you share any other resources?

View solution in original post

3 Replies

Avatar

Moderator

Hi @Shaini_Gupta 

 

You can use <Field>.length() function to get the length of the string. 

To ensure only 5 length string will be ingested you can choose either of the 2 approaches -->

  • Define the length in schema level (also you can set regex pattern there if needed) and enable partial ingestion.
  • In data prep you can use if-else logic to only return the string that are of  length 5 and nullify the rest which are not. So in dataset only length 5 values will be populated rest will be stored null.

 

Regards,

Arijit Ghosh

Avatar

Administrator

@Shalini_Gupta Did you find the suggested solutions helpful? It would be great if you can mark the answer as correct for posterity. If you have found out solution yourself, share it with wider audience in the community..

Avatar

Correct answer by
Level 1

@arijitg - I can confirm that <field>.length() will work in Data Prep mapping rules, though it doesn't seem to be documented in the online Data Prep mapping functions documentation (https://experienceleague.adobe.com/docs/experience-platform/data-prep/functions.html?lang=en). 

 

How did you come to learn about this function?  I wonder if there are other functions that could be useful - can you share any other resources?