0

I Created One SharePoint List and Also Created Three views.

My requirement is I want to hide that views based on users How to do that using Rest API ?

2

For every view you can set users or groups who can see it or not.

Open list with view you want to set -> go to Edit page -> click on right corner of list -> click Edit webpart -> Unroll part "Advanced" in the right panel, and there is field PieplePicker named "Target Audiences".

If you add some people here, they will see it. If someone isn't here, he can see only the name of view, but nothing will represent under this view for this user. Hope it helps you.

2

You can try this:

  1. Edit the list view webpart
  2. Set the target audience for the webpart - you can creat a sharepoint group with a list of user who should see the webpart and add this group to the target audience.

For a REST API based solution check these answers:

Check users group membership via REST API using AD-Groups in SP-Groups

Get the group of the current user using REST API

0
  1. Enter the Designer.
  2. Expand the Views section and then click the view you want to modify.
  3. Click Properties.
  4. Uncheck Show this view to others in the 'view' menu.
-1

Out of the Box functionality in SharePoint List can be used in this case. But to delete an item through REST API, we generally make use of following REST URL.

Hope this link might help.

http://blog.binaryrepublik.com/2016/03/deleted-list-item-through-rest-api-is.html#.V7LoXFR95kU

Regards, Navin

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

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.