Skip to main content
Nintex Community Menu Bar
Solved

How to get list or library GUID in Nintex workflow

  • November 12, 2021
  • 4 replies
  • 222 views

Forum|alt.badge.img+7

In SP 2016, I have a Nintex workflow that needs to convert a library name (input by a user) into list GUID. This GUID will be used in CAML query. 

 

How can I retrieve the GUID of a list/library?

 

Many thanks.

 

Mayank

Best answer by MegaJerk

I'm not sure if this will answer your question with an acceptable work around but I assume that you want the GUID so that you can make your CAML query against the ID attribute of the list in question, like: 

<List ID="{BLAH-BLAH-BLAH-BLAH}" />

 

However, if you use the Title attribute instead, you should be able to use the user's input string directly, like:

<Query> <Lists> <List Title="Your Library List Here" /> </Lists> <ViewFields> <FieldRef Name="ID" /> </ViewFields> <Where> <IsNotNull> <FieldRef Name="Title" /> </IsNotNull> </Where> </Query>

 

 

Hope this helps! 

4 replies

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • Answer
  • November 13, 2021

I'm not sure if this will answer your question with an acceptable work around but I assume that you want the GUID so that you can make your CAML query against the ID attribute of the list in question, like: 

<List ID="{BLAH-BLAH-BLAH-BLAH}" />

 

However, if you use the Title attribute instead, you should be able to use the user's input string directly, like:

<Query> <Lists> <List Title="Your Library List Here" /> </Lists> <ViewFields> <FieldRef Name="ID" /> </ViewFields> <Where> <IsNotNull> <FieldRef Name="Title" /> </IsNotNull> </Where> </Query>

 

 

Hope this helps! 


Forum|alt.badge.img+7
  • Author
  • Rookie
  • November 22, 2021
Thank you. That helped a lot.

MegaJerk
Forum|alt.badge.img+14
  • Scholar
  • November 25, 2021

it's a very helpful thing to know, but for whatever reason I don't see people often writing out their CAML Queries in this way. I suspect because the GUID is immutable, so in that sense, more reliable than using a standard string. However I feel like no matter what you need to do error checking to make sure that you were able to complete the query any way, so it seems like the same amount of work to me! 

Good to hear that it helped you in this case! 


  • July 10, 2024

Sorry for bumping this up, but I have a question relating to this. I want to retrieve the data from a certain list column through the CAML editor, but the CAML editor references Sharepoints internal column names, not their display names. I know how to find the internal name manually, but when I have the column (display) name as a workflow variable, do you know if you can do a similar trick as using List Title instead of the List ID for the column names to use the display name rather than the internal name?