Questions tagged [spfielduser]

The tag has no usage guidance.

3
votes
1answer
122 views

How i can associate an SPFieldUser to a SPGroup

I am working on developing an event receiver inside my sharepoint 2013 farm on-premises. and inside the event receiver i am trying to assign a list column to a SPGroup. what i am trying to do is ...
0
votes
1answer
304 views

SPFieldUserValue.User property is null for few users only

SPFieldUserValue userValue = new SPFieldUserValue(SPContext.Current.Web, DisplayName); SPUser user = userValue.User; I wanted to fetch user from site (web) using display name and display that ...
2
votes
2answers
144 views

'SPFieldUserValue' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'SPFieldUserValue'

I am trying to remove a user from my SPFieldUserValueCollection but I keep get the error 'SPFieldUserValue' does not contain a definition for 'Add' and no extension method 'Add' accepting a first ...
1
vote
3answers
1k views

Sharepoint Online JavaScript convert from SPUser to SPFieldUser and get name

How can I get full name from SPUser? I got him from get_currentUser() from web context. And how can I convert from SPUser to SPFieldUser in JS? EDIT: I need it to compare, I get from list field ...
2
votes
0answers
877 views

check if User field value is a user or a group using CSOM/JSOM

I am able to get a user field and its value from a list using CSOM/JSOM. I cannot figure out how to get if the value is a user or a group. ExecuteOrDelayUntilScriptLoaded(function() { var context ...
2
votes
1answer
453 views

How to manipulate LikeBy, NoOfLikes, RatedBy, AverageRating, UserRating using CSOM

I want SPFieldUserValueCollection in CSOM. How do I and manipulate it? In particular, how to manipulate LikeBy, NoOfLikes, RatedBy, AverageRating, UserRating all using strictly CSOM.
1
vote
1answer
2k views

SharePoint 365: Updating User-type fields through REST api

On my SharePoint online (version 16.0.0.5312), when I retrieve items through REST api: /some-site/_api/web/lists/getbyTitle('ListName')/items(3), the API returns a new property for User-type fields. ...
0
votes
1answer
2k views

How to get the SPFieldLookup object from a SPListItem

I have an SPListItem from a SPList That contains a Lookup Field. How do I do to get the SPFieldLookup object from this item? I need to get the other fields from this object an not only the title.
0
votes
1answer
3k views

Remove user from SPFieldUserValueCollection

I have a "person or group" type column in my calendar list as "Participants". I need to add and remove users from this column. Adding users works fine. When trying to remove a user it does not get ...
1
vote
1answer
1k views

How to get username through REST

I am currently working with a task where you have a SPList in one farm that holds some data that we need to aggregate into a view on another farm. Therefore I am working on a Visual Web Part that ...
0
votes
3answers
7k views

Unable to cast object of type 'System.String' to type 'Microsoft.SharePoint.SPFieldUserValue'

I want to get the user value from the Person or Group column in code behind. My code is: List<string> manager = GeneralMethods.GetUsers((SPFieldUserValueCollection)item[FieldNames.Manager]); ...
0
votes
3answers
2k views

Change the value of Author field

I am copying over items from one list to another list. After copying the "Author" field gets populated with "System Account" and so I wish to update some fields in the destination list as follows. I ...
0
votes
2answers
329 views

Can find user in peopleeditor but not in web?

I want to assign the value from a peopleeditor control to a user field in C#. I have a resolved entity in the people editor, but when passing the SPUserId into the SPFieldUserValue constructor along ...
0
votes
1answer
457 views

Custom Field PropertySchema Type=User

I have a custom field in my SP Project. In my .xml file, I have a propertySchema and a user field inside it. Currently the field does not accept multiple users/groups. How can I change that? I ...
9
votes
3answers
26k views

How to read a User field value for a list item

I've got a content type that contains a filed of the type user. When I want to read the ListItem I just get a string containing the users name instead of a object which contains Name, Username, E-Mail ...
0
votes
1answer
1k views

Binding User to SPGridview

I have an SPGridview and I made a CAML Query to get the modifier of a document. When I bind it to the SPGridview with a SPBoundfield the value is displayed like this: 1;#HANSEVIS13\sschindler All ...
15
votes
3answers
22k views

How do I convert SPUser to SPFieldUser?

I have a field in a list that accepts an SPFieldUser object. I have an SPUser object that I would like to populate that field with, but I cannot implicitly convert from one to the other. How would I ...
25
votes
1answer
38k views

How to get a SPFieldLookupValue from an SPListItem?

When you get an SPListItemCollection from a SPList.GetItems(SPQuery) request, and the items have SPFieldUser or SPFieldLookup fields, what is the sexy way to get typed values, not the item["Field"]....