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]", ":" )[2], "]", "" ) )
Do you know if there is any more direct way to get it?
thank you
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.
tointeger(a!groupsByName("myGroupName"))
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
a!forEach( items: tointeger(extract(fv!row.c8,"[Group:","]")), expression: group(fv!item,"groupName"), )
Here c8 is giving [Group:33] it will help you convert that number into group