Solved

How to get list or library GUID in Nintex workflow

  • 12 November 2021
  • 3 replies
  • 72 views

Badge +6

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

icon

Best answer by MegaJerk 13 November 2021, 07:17

View original

3 replies

Userlevel 5
Badge +14

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! 

Badge +6
Thank you. That helped a lot.
Userlevel 5
Badge +14

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! 

Reply