Possibility to define offer attributes as string array instead of string? | Community
Skip to main content
arpan-garg
New Participant
August 8, 2024
Solved

Possibility to define offer attributes as string array instead of string?

  • August 8, 2024
  • 1 reply
  • 639 views

We are using offer attributes in AJO to define few dates and later we want to use this offer attribute to calculate the ranking of the offers

 

The offer attribute has the following structure

offerApplicableOn 21-09-2024,23-09-2024,25-09-2024

 

In our ranking we are using offer.characteristics.get("offerApplicableOn") to fetch the value of the dates. Now we want to split it by comma and check compare each date. Suprisingly there is not split functionality available to do so in pql https://experienceleague.adobe.com/en/docs/experience-platform/segmentation/pql/string-functions

 

Is there any way to define offer characteristics as a string array instead of string? 

 

Thanks,

Arpan

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

Hi @arpan-garg , Not sure if this helps, but can you please check if RegEx can be used? Something like below.

 

{STRING}.regexGroup("\\d{2}-\\d{2}-\\d{4}")

1 reply

Pradeep_Kumar_Srivastav
Pradeep_Kumar_SrivastavAccepted solution
New Participant
August 9, 2024

Hi @arpan-garg , Not sure if this helps, but can you please check if RegEx can be used? Something like below.

 

{STRING}.regexGroup("\\d{2}-\\d{2}-\\d{4}")