Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!
SOLVED

SiteCatalyst s.apl plug-in documentation for unique-check wrong?

Avatar

Level 1

Hi guys,

I was having a deeper look into the s.apl plug-in and stumbled upon something in the documentation which seems to be incorrect concerning the optional fourth parameter (see also https://microsite.omniture.com/t2/help/en_US/sc/implement/index.html#appendList).

Documentation says: "u (optional, defaults to 0) Unique value check. 0=no unique check, value is always appended. 1=case-insensitive check, append only if value isn't in list. 2=case-sensitive check, append only if value isn't in list."

However, the example "Use case scenario 2" uses the case-sensitive check (2) to treat "History" and "history" as the same values?! 
Correct me if I'm wrong, but isn't that the definition of a case-insensitive check?

Having a look at the plug-in code indicates the same behavior:

... if(u){ var i,n,a=s.split(l,d);     for(i=0;i<a.length;i++){ n = a[i];         // u==1: equality check == case-sensitive         // u==2: toLowerCase comparison == case-insensitive m = m || ( u==1 ? (n==v) : (n.toLowerCase() == v.toLowerCase()) );     } } ...

So actually, passing "1" as value should be the case-sensitive check and "2" the case-insensitive check. 

This behavior most likely only causes issues if you're using it for (case-sensitive) list props but am I really the first person who encounters this problem?

Cheers from Switzerland,
Bjoern 

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hi Bjoern,

thank you for pointing this out. I checked our internal consulting documentation and it seems that you are right:

"u=unique value mode (0=no unique check, 1=case sensitive, 2=case insensitive)".

I will raise this internally and see if we can get this updated.

Thanks!

View solution in original post

2 Replies

Avatar

Correct answer by
Level 1

Hi Bjoern,

thank you for pointing this out. I checked our internal consulting documentation and it seems that you are right:

"u=unique value mode (0=no unique check, 1=case sensitive, 2=case insensitive)".

I will raise this internally and see if we can get this updated.

Thanks!

Avatar

Level 4

Hi eve,

The document is not updated yet. Thankfully I found this forum update.
appendList

Thanks
Manish