- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
02-15-2016 05:59 AM
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?
Solved! Go to Solution.
02-18-2016 04:11 AM - edited 02-18-2016 04:15 AM
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
05-11-2017 09:14 PM
>> 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...
06-14-2017 03:05 AM
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
Copyright All Rights Reserved © 2008-2023