Skip to main content

I'm looking to create an editable list view for a SharePoint list that has a People field.

I want to use a picker control to facilitate the input needed for the SharePoint list when a new row is added or a row is edited.

The smartobject for the List has two properties for the People field.. One is the internal ID number of the user inside SharePoint and the other has "(value)" appended to the column name and will be the display name of the person.

 

I tried using the URM - AD User smartobject, pushing in the Name property, which is domainusername. But the item in the SharePoint list did not contain the user's information.

 

I then looked at one of the generated forms and find that the new view has a picker preconfigured with the "sharePoint Integration People Picker Source" smartobject and that it stores "ID" and displays "Display Name" I also see that the control has two parts. It has a Field and Display Field property with the Field property bound to the SharePoint list smartobject property that has the internal ID number and the Display field tied to the one with "(value)" on it...

 

When I go to configure the same thing in an editable list, changing the Field property of the picker control switches the list as well. This results in a removal of the picker as a control, setting it as a text field.. (besides it will show the ID numbers and not the names)...

 

So anyone know how to do this? Or am I working with two views on the form with a refresh?

Hi,

 

When you register the K2 for SharePoint app, the Service Instance behind the scenes generates several "helper" service objects which you can use for various things.

One of these is a User object under Mangaement > User (picture below). This service object has a method called Get Users which will return a list of all the users in the SharePoint site and it contains the ID, LoginName, Title, Email and type of principal.

10898i7A087ECD7B16DF77.png

Create a new SmartObject and configure it to look at this Service Object.

Then bind the picker control to the Get Users method.

Then when your picker resolves, you can set the ID from the return properties as the actual value of the picker.

 

Hope this helps!

Regards,

JohanL


So, as opposed to starting a new thread I figured I would add to this one seeing as it is the same problem I am having.

 

First, I should state that I have a list (SharePoint 2013) that includes a Person/Group field, and I am trying to use a picker control to manage the value of this field (among others) in an editable list.

 

It seems to me that the form developer should be free to bind the controls in an editable list display row column to a different field than the control in the edit row. If only I could do that I wouldn't have this problem, which seems like it should be pretty straightfoward to achieve. The picker control allows me to select a user, which then stores the user's ID in the field to which it is bound (Assigned To), but I don't want the labels in the display rows to show the ID -- they should show the User Title. If you change the finding of the display row label to the value field (Assigned To (Value)) then the rows will display the users' names but then the picker fails, predictably enough because the picker control's binding was also changed. Interestingly, you can unbind the label in the display rows without affecting the picker in the edit row, but the moment you rebind the label the picker is rebound as well. Argh!

 

I am trying to find a creative way around this, but I haven't yet, and everything I can think of is a dirtier hack than the last. I would rather not have to find a creative way to do this. I am hoping that I am missing something, and when I learn what that something is I will slap my forehead.

 

Although I don't see the two issues outlined on this page relevant, are we actually supposed to implement this sort of workaround? http://help.k2.com/kb001414.

 

Cheers,

 

Simon.


Bumping this thread because Wally's issue is exactly the one I came here to find a solution to.  Has this been solved?

 

Our situation is pretty similar.  We have picker controls in our Add/Edit Items row.  The ID is the data ID, but that's not something the user would know anything about so the picker Display column is something they will understand (Name, Email, etc).  When the item is saved, though, and added to the display rows all we get is the ID.  We can't figure out how to get the Display column.  

 

Wally, has this been resolved on your end?  Or does anyone else have a solution?

 

Thanks


In the save method, expand the control and then the smartobject Sharepoint People Picker Source. Under there grab the Display Name field and drag to the desired field you wish to save as.


I may not be understanding the question so let me lay out what I think you want.

You have an editable list where in the top you see the values and when you click or double click or add you get a row to edit. You want to select from AD a valid user showing the display name and write this to a field of type user in SharePoint.

 

In the layout of the view you have an add edit row where you want a picker that pulls from the AD smart object (yes you can use SharePoint but it is usually more difficult and slower).

When you create the smart objects from the SharePoint list your people field come is as two fields let’s say your field is "Originator" the two that you will see is 1)Originator and 2) Originator (value). This can be confusing but one holds the display name and the other holds the SharePoint ID from the user profile service. The (Value) is the display name.

 

In your layout you want to use the Originator (Value) field. This will show the display name.

 

In the add edit field you want to change the type to picker and set it is use the Active Directory Service2 – Ad User smart object. Use th get Users method, Select only: name, Display name and Email as the filter properties (if you select all you will get an error).

Set the identified to Name and Display to Display Name 

  

In details make sure you set the field to Originator and the Display field to Originator (Value)

  

This should be all you need to do I have done this with dozens of solutions.

 

I hope this helps.

 

 

 


Reply