0

I have a list (Teamsites) in SP 2013 onPrem with a people picker field (Owner).

Now I want show a counter of all list entries where the current user is standing in the Owner-Field.

How i can realized it in Javascript?

0

User REST API to get the List Items where Owner=CurrentUser. Hope you are aware how to call Rest API in Javascript code.if not please see here

using below REST API you will be able to get the filtered List Item

https://[Your SharePoint URL]/_api/web/lists/YourList/items?$select=Title&$expand=FieldValuesAsText/Owner&$filter=Owner eq 1

here in code Owner eq 1 "1" is the current user ID which you can get using _spPageContextInfo.userId in Javascript code.

Once you get the result from rest ,get the count in Success method using below code data.d.results.length

  • It isn't working. I forgot to say that the owen-field is a multiple choice field. – cvb Sep 20 '18 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.