Getting Unique Id for a list

Syed Mauze Rehan

How can I get the UniqueId for a List?(say Documents list)

For a root level item(meaning this item is at the first level of Documents list) when I get its ParentUniqueId, it gives me the UniqueId of the list it lies under. Now my problem is that I'm unable to get the UniqueId for a list(when I get the meta for it) so that I can differentiate that this ParentUniqueId is either my list's UniqueId(which in this case is Documents list) or the UniqueId for another item which this item lies under(file within a folder or folder within a folder).

Much appreciated!

Vadim Gremyachev

The point is that ParentUniqueId property stores the parent container id, in case of List Item the container is always Folder.

Example 1:

Assume the following structure for a Documents library:

Documents (library)
   |
   Document.docx (document item with id = 1)

Then the query:

/_api/Web/Lists/getByTitle('Documents')/items(1)/FieldValuesAsText?$select=ParentUniqueId

will return the value of SP.List.rootFolder.

Note: the returned value corresponds to Folder.UniqueId and not to List.Id

The following queries demonstrate how to retrieve Documents library RootFolder.UniqueId:

/_api/Web/Lists/getByTitle('Documents')/rootfolder/UniqueId

or

/_api/Web/GetFolderByServerRelativeUrl('Shared Documents')/UniqueId

Example 2

Assume the following structure for a Documents library:

Documents (library)
   |
   Orders (folder)
      |
      Document.docx (document item with id = 2)

Then the query:

/_api/Web/Lists/getByTitle('Documents')/items(2)/FieldValuesAsText?$select=ParentUniqueId

will return the Folder.UniqueId value of Orders folder.

The corresponding query to retrieve Orders folder UniqueId property:

/_api/Web/GetFolderByServerRelativeUrl('Shared Documents/Orders')/UniqueId

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Getting Unique Id for a list

From Dev

Getting unique id in firebase

From Dev

Getting a unique hardware ID with Python

From Dev

Getting a unique hardware ID with Python

From Dev

Getting unique id's Bank program java

From Dev

Getting NFC Unique ID within the oncreate method

From Dev

Getting unique id's Bank program java

From Dev

Getting unique ID from iPhone NFC

From Dev

mySQL getting a list of unique values within a group by

From Dev

Getting list of rows with id, grouped by other id

From Dev

Merging dictionaries into one list of dictionaries on a unique id

From Dev

Add a unique ID to a menu item list

From Dev

Search list of unique _id as String in mongoDB with find()

From Dev

Create list with unique id in Java and manipulate it

From Dev

Getting my Post's ID to be random (but unique) string

From Dev

Getting the Unique Transaction ID seen by the customer from Express Checkout

From Dev

Getting Unique System ID on Mac using C#(Mono)

From Dev

Getting error while generating the unique id using Python

From Dev

Getting Primary ID on clicking a List Item in Android

From Dev

Getting ID of the Selected Value in dropdown list

From Dev

Getting id of item in list<object> in JSF

From Dev

Getting id of a swiped list element Jquery Mobile

From Dev

Getting a list of unique hash key values from dynamodb using boto

From Dev

Getting a list of unique embedded/nested objects in a MongoDB document

From Dev

Getting a count of unique strings from a List<string[]> into a dictionary

From Java

Getting first n unique elements from Python list

From Dev

Getting first n unique elements from Python list

From Dev

Getting count of unique values in pandas Dataframe when there is a list object in a column

From Dev

Python - How to flatten nested list getting unique values

Related Related

  1. 1

    Getting Unique Id for a list

  2. 2

    Getting unique id in firebase

  3. 3

    Getting a unique hardware ID with Python

  4. 4

    Getting a unique hardware ID with Python

  5. 5

    Getting unique id's Bank program java

  6. 6

    Getting NFC Unique ID within the oncreate method

  7. 7

    Getting unique id's Bank program java

  8. 8

    Getting unique ID from iPhone NFC

  9. 9

    mySQL getting a list of unique values within a group by

  10. 10

    Getting list of rows with id, grouped by other id

  11. 11

    Merging dictionaries into one list of dictionaries on a unique id

  12. 12

    Add a unique ID to a menu item list

  13. 13

    Search list of unique _id as String in mongoDB with find()

  14. 14

    Create list with unique id in Java and manipulate it

  15. 15

    Getting my Post's ID to be random (but unique) string

  16. 16

    Getting the Unique Transaction ID seen by the customer from Express Checkout

  17. 17

    Getting Unique System ID on Mac using C#(Mono)

  18. 18

    Getting error while generating the unique id using Python

  19. 19

    Getting Primary ID on clicking a List Item in Android

  20. 20

    Getting ID of the Selected Value in dropdown list

  21. 21

    Getting id of item in list<object> in JSF

  22. 22

    Getting id of a swiped list element Jquery Mobile

  23. 23

    Getting a list of unique hash key values from dynamodb using boto

  24. 24

    Getting a list of unique embedded/nested objects in a MongoDB document

  25. 25

    Getting a count of unique strings from a List<string[]> into a dictionary

  26. 26

    Getting first n unique elements from Python list

  27. 27

    Getting first n unique elements from Python list

  28. 28

    Getting count of unique values in pandas Dataframe when there is a list object in a column

  29. 29

    Python - How to flatten nested list getting unique values

HotTag

Archive