Export profiles selectively

Gold Contributor
Gold Contributor

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

4 REPLIES 4

Export profiles selectively

Tealium Employee

@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.

Export profiles selectively

Gold Contributor
Gold Contributor

@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

Export profiles selectively

Tealium Employee

@DeebuGeorge this should go in the Developer Tools Console:

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

Export profiles selectively

Gold Contributor
Gold Contributor

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

Public