Questions tagged [spfielduser]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
25 views

Cannot save FieldUserValue. Error: "Invalid data has been used to update the list item. The field you are trying to update may be read only."

this is my code: var context = new SP.ClientContext.get_current(); var targetList = context.get_web().get_lists().getByTitle("reqLegales"); //my list context.load(targetList); var item = ...
Walter Di Biase's user avatar
3 votes
1 answer
220 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 ...
John John's user avatar
0 votes
1 answer
467 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 ...
raju's user avatar
  • 153
2 votes
2 answers
316 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 ...
Ed Charles Diesel's user avatar
1 vote
3 answers
2k 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 ...
Rhonin's user avatar
  • 163
2 votes
1 answer
1k 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 ...
IMTheNachoMan's user avatar
2 votes
1 answer
722 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.
Ashwin Kheta's user avatar
1 vote
1 answer
4k 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. ...
Pau Codina's user avatar
0 votes
1 answer
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.
ameliapond's user avatar
1 vote
1 answer
4k 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 ...
Shaamil's user avatar
  • 708
1 vote
1 answer
3k 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 ...
Padawan's user avatar
  • 179
0 votes
3 answers
9k 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]); ...
users1100's user avatar
  • 3,230
0 votes
3 answers
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 ...
Perplexed's user avatar
  • 531
0 votes
2 answers
342 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 ...
JᴀʏMᴇᴇ's user avatar
0 votes
1 answer
471 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 ...
Umm....'s user avatar
  • 88
9 votes
3 answers
33k 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 ...
MOI's user avatar
  • 1,031
0 votes
1 answer
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 ...
Steffen Schindler's user avatar
17 votes
3 answers
24k 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 ...
Meyer Denney's user avatar
  • 2,864
27 votes
1 answer
41k 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"]....
Alexey Krasheninnikov's user avatar