gs.getUserDisplayName() in the mail script is returning System name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 02:03 PM
Hello guys,
I'm using gs.getUserDisplayName() in the mail script in a notification being triggered by a subflow and it's bringing System instead of the logged in user's name. Would there be any other way to do it?
Thanks,
Flavio

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 02:06 PM
Do you have option to pass the username from the flow to subflow?
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 02:06 PM
Hello Flavio,
Since the flow is being executed in the background by the system user, when you use the gs.getUserDisplayName() you will get the value "system".
But if that is being executed in the background, which user name do you want to pick?
Can't you pass the Display name of the logged user as a parameter to the subflow?
Hope this helps!
Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Best Regards,
Filipe Cruz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 04:48 PM
The notification being fired, I need to get the username to fill the body with the current user. And in the subflow, I created a custom Action to trigger the notification and pass a string value in parm1 to be inserted into the body as well. How would I be able to pass from the subflow by parameters the name of the user?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 09:48 AM
If the user updated something, which triggers this subflow, you can also pick the user name from Updated By field on the current record.
Please mark this response as correct or helpful if it assisted you with your question.