- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
06-05-2018 07:11 AM - edited 06-05-2018 07:14 AM
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
Solved! Go to Solution.
06-05-2018 08:22 AM - edited 06-05-2018 08:29 AM
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.
06-07-2018 01:35 AM - edited 06-08-2018 03:45 AM
@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
06-07-2018 07:52 AM - last edited on 06-07-2018 10:18 AM by kathleen_jo
@DeebuGeorge this should go in the Developer Tools Console:
@dan_george: Thank you Dan, you just made my day.
Copyright All Rights Reserved © 2008-2023