cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

userprofilelookup with multiple people

Hi,

 

I have a people picker field on my form that needs to grab multiple people.   I want the ability to pull real names from this information for an email report that is generated in my workflow and it works great using a calculated column and the following formula

 

userProfileLookup(Meetingattendees, "FirstName")+" "+userProfileLookup(Meetingattendees, "LastName")

 

 

the issue I run into is what if I have 2+ names in my field?   This causes my calc column to return the #Value! instead of real names.   Any ideas?

Labels: (2)
Tags (1)
0 Kudos
Reply
2 Replies
Highlighted
Workflow Hero

Re: userprofilelookup with multiple people

The way to do this :

1- Create a Text variable

2 - Set this variable with your multi-users people field --> use "Login splitted by comma" or something like this (don't know the real syntax in english version)

You will get something like "User1;User2;User 3" in your variable.

3 - Use regular expression to split on ";" char and save the result in a collection

4- You can now do a "for each" loop on your collection to create your email body

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: userprofilelookup with multiple people

I was able to add several by just using the + between them but the issue I have now run into is the people picker is incredibly slow while the calc field resolves the names.   Is there a better way to do this?   My people picker may have up to 25 people in the list and I need a way to resolve their userID to real name.   I would prefer to use a workflow for this but I don't have the LDAP function available to me.

My ugly calc formula

userProfileLookup(Meetingattendees[0], "FirstName")+" "+userProfileLookup(Meetingattendees[0], "LastName")+" "+userProfileLookup(Meetingattendees[1], "FirstName")+" "+userProfileLookup(Meetingattendees[1], "LastName")+" "+userProfileLookup(Meetingattendees[2], "FirstName")+" "+userProfileLookup(Meetingattendees[2], "LastName")+" "+userProfileLookup(Meetingattendees[3], "FirstName")+" "+userProfileLookup(Meetingattendees[3], "LastName")+" "+userProfileLookup(Meetingattendees[4], "FirstName")+" "+userProfileLookup(Meetingattendees[4], "LastName")+" "+userProfileLookup(Meetingattendees[5], "FirstName")+" "+userProfileLookup(Meetingattendees[5], "LastName")+" "+userProfileLookup(Meetingattendees[6], "FirstName")+" "+userProfileLookup(Meetingattendees[6], "LastName")+" "+userProfileLookup(Meetingattendees[7], "FirstName")+" "+userProfileLookup(Meetingattendees[7], "LastName")+" "+userProfileLookup(Meetingattendees[8], "FirstName")+" "+userProfileLookup(Meetingattendees[8], "LastName")+" "+userProfileLookup(Meetingattendees[9], "FirstName")+" "+userProfileLookup(Meetingattendees[9], "LastName")+" "+userProfileLookup(Meetingattendees[10], "FirstName")+" "+userProfileLookup(Meetingattendees[10], "LastName")+" "+userProfileLookup(Meetingattendees[11], "FirstName")+" "+userProfileLookup(Meetingattendees[11], "LastName")+" "+userProfileLookup(Meetingattendees[12], "FirstName")+" "+userProfileLookup(Meetingattendees[12], "LastName")+" "+userProfileLookup(Meetingattendees[13], "FirstName")+" "+userProfileLookup(Meetingattendees[13], "LastName")+" "+userProfileLookup(Meetingattendees[14], "FirstName")+" "+userProfileLookup(Meetingattendees[14], "LastName")

0 Kudos
Accept as Solution Reply