The CreatorCon Call for Content is officially open! Get started here.

Sai Kumar B
Mega Sage

Hi All,

Today I have found an amazing undocumented API that outputs all logged-in user group sys_id(s). You can use this to reduce the amount of scripting 😉 

You can try this in your Background script

gs.print(gs.getUser().getMyGroups())

Output : 

find_real_file.png

Regards,
Sai Kumar

Comments
Patrik Z
Giga Guru

Hi, yea but the the problem is the returned value is not an array.

PatrikZ_0-1724921466807.png

 

Do you know what type of an object is returned?

Manolis Sgouro1
Tera Contributor

Hello @Patrik Z ,

 

It's an iterator, you can use ".next()" to go through its attributes.

Paul Kunze
Tera Guru

You can easily convert the object to a comma-separated String like this:

var myGroups = JSON.parse(JSON.stringify(gs.getUser().getMyGroups())).toString();

 

Looks like overkill but works 🙂

 

 

Version history
Last update:
‎12-24-2021 10:36 PM
Updated by: