Hello,I am using the function a! groupsByName ("nameGroup") to get the id from the name of a group but the result returns us[Group: 123] and I have to do the treatment to get the 123.
toInteger( substitute( split( "[Group: 123]", ":" ), "]", "" ) )
Do you know if there is any more direct way to get it?
Discussion posts and replies are publicly visible
You can use the group() function to get its id.
Something like: group(a!groupByName("groupName"), "id")
cast( typeof( 1 ), a!groupsByName( "nameGroup" ))
Good option thank you very much
If you call tointeger() on a string, it will automatically strip out everything from the string that isn't a number and return the resulting integer. And in this case, I think the type returned is actually "group type", which you can just call toInteger on itself - either way, you should probably be able to do what you were originally trying to do with a lot less fuss.
Just keep in mind that if there's ever any possibility that 2 groups have the same name, a!groupsByName() will return an array.
This worked perfecct
© 2020 Appian. All rights reserved.