Building string array of unique values

Bronze Contributor
Bronze Contributor

Hello all,

 
When on a product detail page, I need to capture the product id, product name, and product price and store in an attribute (or collection of attributes) for every product viewed during a visit.
 
I'm struggling to figure out how to handle duplicates.  When using a collection of attributes, sets of strings follow alphabetic order which will make the product ids, names, and prices out of alignment, however I don't have to worry about duplicates.
 
Thanks,
John Hermes
 
 
Thanks,
John Hermes
4 REPLIES 4

Building string array of unique values

Gold Contributor
Gold Contributor

Hi @jhermes ,

Just this is a point from my side. Other's may have better solution. 

To store the values in pushed order, we can use array of string attributes and to manage duplicates we can use enrichment rules.

I Just tried roughly in my account, attaching screenshots here

1) Enrichment Rules

Enrichment Rules.JPG

2) Enriched Attribute in Trace

Array of Strings.JPG

Thanks,

VJ

Its Not Who I am Underneath, but What I Do That Defines Me

Building string array of unique values

Bronze Contributor
Bronze Contributor

Hello @dragooon ,

Thank you so much for helping out with this.  This logic works for what I am trying to do.

The "or" part is what I was missing.  I didn't think about the attribute not being assigned / initialized.

Thank you,

John Hermes

Thanks,
John Hermes

Building string array of unique values

Bronze Contributor
Bronze Contributor

Thank you so much @dragooon because this actually solved something I was stuck with.

I have only one question: does it seem to you than there's a limit of characters or something that prevents the array to value every single item you would expect?

I'll explain better: I've created an array with product details (such as name, url, image, etc.) that will value the array every time I visit a product page. What I noticed is that at some point the array values don't update anymore when I visit other product pages, it looks like there's some sort of limitations..

 

Thanks,

v.

Building string array of unique values

Gold Contributor
Gold Contributor

Hi @valentina_LM ,

I would request you to reach the support team, since I am not much clear about the limit.

In mean time please refer this link

https://community.tealiumiq.com/t5/Customer-Data-Hub/Using-Attributes/ta-p/11926#toc-hId--1935708794

 

Thanks,

VJ

Its Not Who I am Underneath, but What I Do That Defines Me
Public