Highlighted

How to LowerCase all data sources except a few?

Silver Contributor
Silver Contributor

I'd like to LowerCase all Data Sources except some of them.

 

The LowerCasing Extension (https://community.tealiumiq.com/t5/Tealium-iQ/Lower-Casing-Extension/ta-p/5634) forces me to list all variables that I want to converto lo lowercase, which is time consuming and difficult to maintain (anyone that add a new data source must remember to add it to the lower-casing list).

 

Can you please add a "convert everything except these variables" logic to the LowerCasing extension?

Or there is a way to obtain this result with the current extension?

3 REPLIES 3
Highlighted

How to LowerCase all data sources except a few?

Tealium Employee

Hi @giacomo_ritucci

 

So the short answer is to contact your AM who can raise an enhancement for you.

In the meantime, you can get this functionality with a JS extension, using the logic of the LowerCasing Extension:

 

 

var exceptions = {'cv1' : 1,'cv3' : 1};

 for (var property in utag.loader.GV(b)) {
   if (exceptions[property]) {
     continue;
   }
   try {
     b[property] = (b[property] instanceof Array || b[property] instanceof Object) ? b[property] : b[property].toString().toLowerCase();
   } catch (e) {}
 }

 

 

Add the items you want to ignore into the exceptions object, and everything else with be lowercased.

 

Adrian

Ask me anything Tealium related or Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.
Highlighted

How to LowerCase all data sources except a few?

Tealium Expert
Tealium Expert

>>  respectfully crashing this thread!  <<

 

Hello @adrian_browning - is this still a working solution for selective lower-casing?  Could you provide a clearer example as far as the data layer or variable names are concerned?  Are cv1 and cv3 the data elements to be excluded from lower casing in this example?    Should/Can I refer to these values as b['variable'] ?

 

Thanks for any updates/ideas...

How to LowerCase all data sources except a few?

Tealium Employee

@mitchellt

 

So in my example above cv1/3 are variables in my data layer.

 b is the data layer at the point in time this extension is running.

You can indeed refer to them b['variable']

 

Adrian 

Ask me anything Tealium related or Javascript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.