Get Display Names for Multiple Entries in PeoplePicker Field?

  • 30 September 2014
  • 10 replies
  • 47 views

Badge +3

Hi All: Using SharePoint 2010 + K2 Designer or Studio: I have a PeoplePicker field with MULTIPLE names in it.  Users can add as many names as they want.  I need to get all their Display Names so I can put the Display Names in an email.

- I have tried all kinds of things including, but not limited to

       - I have tried Split to get the values into an array (prefacing each value with "K2:") and then feeding the array to the 'Get Email for User' Smart Object.  Nope.  That didn't work.  It just returned a blank.

       - I supposed if I could figure out how to step through an array in Designer or Studio, I could gather the values individually, but I'm not sure that's possible.

 

Suggestions? Please?

 

Thanks!


10 replies

Badge +10

Can you provide a use case so I can better understand the goal here?  What is the intended outcome?

Badge +8

You should be able to put all of their usernames into a SharePoint column that supports multiple user names then fire a smartobject aginst that list to pull it into your email.


 


I can test it out tomorrow to see how it works.

Badge +3

Thanks to Mike and David for taking an interest in this topic.

For Mike: the attached screen shot shows

a) a SharePoint form with multi-person People Picker field and 

b) the email that needs to be generated by the workflow

 

For David:

Yes, SmartObjects can get the Display Name from a people picker field, but

a) they do not seem to be able to accept a string with more than one user ID

b) they do not seem to be able to accept an array of user IDs

c) I can't figure out how to step through an array of IDs, passing each one to the SmartObject

in K2 Designer,  I've been working with the SmartObject Get Email for User and Groups

in K2 Studio, I've been working with the SmartObject Get Email for User (found under Task AllocationUsers and Groups)


13063iA932599666775389.png
Badge +8

I tested and it seemed to work on my end.  I created a simple custom list for awards, with title and award nomoniees.  Nomoniees column allowed multple entries for users.  In the custom list I'm firing the workflow when a new item is created and populate the email body with the nomoniee names.


 


 


 14713i8C3C114CE6693807.png

 

Received Email:

 

12197i6261EEE25361F039.png

 

Is this what your shooting for?
Badge +3

Whaaat? Which SmartObject are you using?  The screen shot attached shows the one I'm <attemping> to use. Obviously, not the right one.

Badge +3

Wow... NOW the image is attached. I hope.


12873iF1E76FE62E52164B.png
Badge +3

Upon further investigation, it appears that David's (great) suggestion to use the Get List Item wizard is only available in K2 Designer for Visual Studio.  Sadly, I am constrained to using K2 Designer for SharePoint OR K2 Studio.  So, if anyone else has any suggestions, please feel free to speak up!

Badge +8

Jw,


 


sorry to hear that.  Sorry i haven't responded in a while.  I'm glad you were at least able to figure out what was going on.

Badge +3

DavidAerne: I have a question for you; Even in a Visual Studio K2 Project, I can't seen to use the GetListItem method the same way you did.  Can you please explain how you did that?  I tried using a SharePoint List Item Event, but that's not the same thing that you did (and my attempt failed to give me the display name, I got the DomainAccount name).

Thanks.

Badge +8

JW,


 


let me try to reproduce this effect in 2010 (of which I believe your using).  I tested in 2013 and it automatically gave me the options for different returns (i.e. email, username, display name).  I think we are shooting for sending those user names to an Active Directory smartobject to get a return on display names.


 

Reply