Reply
Highlighted
Visitor
Posts: 10
Registered: ‎03-28-2018
Accepted Solution

Export profiles selectively

[ Edited ]

Hi Team,

Is there a way to export list of profiles based on some parameters like :-

1) All profiles containing word "PT"

or 

2)All profiles containing word "Shop" 

to an excel or pdf file.

Thanks in advance

Regards

Deebu George

Reply
0 Kudos
Tealium Employee
Posts: 57
Registered: ‎09-01-2015

Re: Export profiles selectively

[ Edited ]

@DeebuGeorge

If you are handy with regex and are comfortable running javascript in the console then you can try adapting this script and running in in the open TIQ window.

update the value for 'account' from 'putyouraccounthere' to your account name and then update the regex statement to suite your needs.

After you run the script copy the 'sortedProfiles' value with  ' copy(sortedProfiles); ' into the console and  then paste normally into a word or excel document.

var account = 'putyouraccounthere';

function getAccountProfiles(account) {
    if ($('#profile_account option[value="' + account + '"]').length) {
        console.log('Going to get profiles for account: ' + account);
        var profiles = [];
        utui.profile.getProfiles(null, {
            account: account
        }, function(data) {
            if (data.profiles.length) {
                //Put the profiles in alphabetical order
                profiles = data.profiles.sort();
            } else {
                console.log('No profiles for ' + account);
            }
        }, null, 1);
        return profiles;
    } else {
        console.log(account + ' isn\'t available for your account.  A search for profiles won\'t be done');
    }
}
var profiles = getAccountProfiles(account);

var sortedProfiles = [];
for (var i = 0; i < profiles.length; i++) {
    // modify regex to suit your needs
    if (profiles[i].match(/PT|Shop/i)) {
         sortedProfiles.push(profiles[i]);
         console.log(profiles[i]);
    }
} 

//copy(sortedProfiles);

Someone else may respond with a custom tool or bookmarklet but this is what I usually use.

Visitor
Posts: 10
Registered: ‎03-28-2018

Re: Export profiles selectively

[ Edited ]

@robert_sabec
Thank you for the suggestion, but we are not able to understand where to run the below script.

We have opened TIQ, but there we could not find any place to run the script. Can you please share a screen shot with the code being pasted.

Thanks in advance

Reply
0 Kudos
Tealium Employee
Posts: 756
Registered: ‎09-01-2015

Re: Export profiles selectively

[ Edited ]

@DeebuGeorge this should go in the Developer Tools Console:

Screen Shot 2018-06-07 at 7.51.25 AM.png

Visitor
Posts: 10
Registered: ‎03-28-2018

Re: Export profiles selectively

@dan_george: Thank you Dan, you just made my day.