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
Solved! Go to Solution.
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!
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!