0

is there any way to fetch view order for a particular view using Rest api?

please help me with some sample code.

  • What do you mean by the view order ? In the order they are displayed or something else ? – Ravi Nov 14 '19 at 10:04
  • it should be the field order in a view how can this be obtained using rest api – Pradeep Nov 14 '19 at 12:31
0

By default the views are sorted in ascending order of their name. You can get all the views of a particular list using the below REST API

https://Your-site-url/_api/web/lists/getbytitle('list-name')/views
0

You can use the below endpoint to get all the fields in a view and returned result of columns will already be in the order of fields selected in your view :

https://Your-site-url/_api/web/lists/getbytitle('ListName')/views('ViewGUID')/ViewFields

You can get the view GUID by following the below steps :

  • Navigate to List Settings.
  • Open the view.
  • copy the URL and look for &View=
  • Copy everything inside {} and paste it in place of ViewGUID in endpoint.

if URL is in encoded then you can decode it using the below URL :

Decode URL

Let me know if this helps you.

  • Did you check it @pradeep? – Ravi Nov 15 '19 at 14:57

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.