Matrix Version: 6.34.0
We’re trying to lean into a bit more automation around our site, specifically around the onboarding of users. We’ve got a Training section where they learn the basics, and I’ve set up a workflow where they submit a page, and we approve. There are a few tasks they do to show they can work within Matrix and the workflow approval acts as a sign-off.
So far, I’ve got a trigger set up on After Workflow Approval: removes them from the training group and sets some metadata values on a custom schema applied to their user account (I do this by grabbing asset_created_by_assetid from the page being submitted).
What I would also like to do, is automatically add them/link them to users groups at this stage. The groups won’t be the same for each user, so I’ve attached a related asset picker metadata field to their user account, and we manually drop some groups in.
The idea is that once the approval happens, Matrix can shuffle them into the right place automatically. We could just continue to manually add them to groups after, but if this could work, it would let us set up the accounts and then leave things alone.
What I’ve tried so far
Create Link action:
Looks like you need to explicitly set groups here, and it only allows a single selection, unless there’s something I do with Dynamic parameters and global keywords or something? Couldn’t find a way to get this to work.
Set Future Lineage action:
Same as above, single selection, but no option for using any kind of dynamic parameters.
Assign User To Groups:
I thought I had it with this one, but no joy here either. The fixed users aren’t any use, as it won’t always be the same groups. If “Join by asset name” took IDs instead or as well, I think I’d be set, but I don’t think I can translate the group IDs to name easily inside the trigger (or can I?).
Bearing in mind, the way I get the user ID I want to assign the groups to, comes from the creator of the page being approved — asset_created_by_assetid.
I know on a page I can spit out something like asset_created_by_assetid^as_asset:asset_metadata_matrixUserGroups and get the array of groups, but can you, in a single line, explode out the asset name of those groups without needing SSJS?
It may well be this can’t be done yet, or there might be a better way to handle it. Open to any and all suggestions