I have a custom list with a custom content type, with a workflow, on SharePoint 2007 as outlined in this other StackExchange question.
I'm using a
Person or Group typed column to contain a list of stakeholder(s), to whom emails are addressed as To: or CC: at various stages in the workflow.
But I would also like to resolve the usernames contained within this column (or dynamic string variable), to their display names. The requirement is to include the people's names in the email salutation. At the moment I'm getting eg
Dear MYDOMAIN\BloggsJ; MYDOMAIN\DoeJ; MYDOMAIN\DoeJohn,
instead of eg
Dear Joe Bloggs, Jane Doe, John Doe,
or even better would be (if it can be done),
Dear Joe Bloggs, Jane Doe, and John Doe,
Broadly, my question is "How do I display a list of users, contained within a
Person or Group column, when that column will contain more than one username?".
Specific statements/questions that may prompt a solution, based on my trains-of-thought so far are:
Is there some setting I can use somewhere to adjust how these names are displayed in workflow-generated emails?
Otherwise, this article describes USING VARIABLES TO RESOLVE USER NAMES... but this process operates on a single
Person or Group, not a semi-colon separated list of people/groups. Is there a way to explode and/or loop over the items within the
Person or Groupcolumn (from within the context of the SharePoint Designer) so that I can use this approach?
I considered just using multiple
Person or Groupfields, each only allowing a single entry... but that seems clunky and as I'm not 100% sure at this stage if I will only ever need to cater for 2 or 3 names, may not be practical.
I considered using calculated columns to break down the list of recipients, but same issue applies regarding the potential for a larger number of names. I think it comes down to requiring a mechanism to loop over the names?
Are there any other 'fresh perspective' or 'outside of the box' approaches that you can think of that may help?
I appreciate your time, thanks.
** EDIT: Further information **
I'm trying to display the usernames in my
Person or group field using the
[%ListItemContentTypeName:PersonOrGroupFieldName%] template field within the "Define e-mail message" GUI of the SPD workflow wizard.
The output of this is always in the form
DOMAINNAME\UserName regardless of what's set for the "Show field:" setting on the
Person or Group's "Edit Column" page, and I've confirmed that SharePoint already has the correct display name as collected from AD (eg changing this setting to "Show field" = "Name" renders the display name, rather than the user name, when looking at the item within the SharePoint site.
So the question becomes "How do I convince the workflow to correctly resolve usernames to display names, when other aspects of SharePoint already appear to be resolving this correctly?"