We are currently experiencing intermittent login issues on Community.  The team is actively working on a fix.

Flow that automates adding/removing group type to a user group after Request from Catalog Item

AlexanderH23091
Tera Contributor

Hi all,

 

i need some help.  We have a catalog item for users to request if they want to add or remove group types like itil etc. The user puts the information in variables and after that i call them in the flow.

And how can i change the group type? If i select the table user group there is only a field Type. And in this field i cannot enter either the variable or the sysid of the variable.

 

Has someone a solution? Or an idea how i can automate it. It must be via Catalog Item the request.

 

Thanks

Alex

16 REPLIES 16

No worries, If my response(solution) works for you then, please hit the Thumb Icon and mark as Correct !!

AlexanderH23091_0-1758875783836.png

i have this problem

@AlexanderH23091 

type field on sys_user_group is list type and refers to table "sys_user_group_type"

So you will have to set the sysId of the record

Note: I assume your variable what_type is referring to table "sys_user_group_type"

If yes then use f(x) script and set it

AnkurBawiskar_1-1758869741030.png

 

AnkurBawiskar_0-1758869719454.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, i am doing this in the script. But it returns object GlideRecord

// Get the sys_ids of the type in the group
var currentTypes = fd_data._3__look_up_record.record.type.toString();
var typeToAdd = fd_data._2__get_catalog_variables.what_type.toString();

if (currentTypes == '') {
    return typeToAdd; // If the list is empty, just add the new type
    } 
else {
    // Combine the current list with the new type, separated by a comma
    return currentTypes + ',' + typeToAdd;
}

 

Now for unexplained reason it updates/returns nothing in the group. Even not object GlideRecord. It still has his assigned group type and nothing more happens