Context placeholder functions allow querying lists so that values from any list can be used in expressions (e.g. [[@Functions.GetFirstValueForQuery('List server-relative or full Url', 'Caml query', 'FieldName')]]).
Read more about context placeholders in expression builder.
CAML Builder for query functions
Open Expression builder and click on Insert CAML query/query function button to open CAML Query Builder dialog.
First of all you need to select list or library on the current site or any site from the current or another site collections to load list fields. Then you can easily create your CAML query and insert query into expression or insert one of the proposed query functions from the drop-down menu.
Note: In the Background Features (Calculated Expression, Scheduled & Triggered Actions) only selecting list or library from current site is available.
To insert CAML query to specific place select query expression and click on Insert CAML query/query functions button. In this case selected query will be replaced by the new one.
Notes:
- Query functions will be inserted as [[@Functions...]] placeholders.
- In case selecting list from any site, you can use list URL, server-relative URL or full URL.
For more information about CAML Builder read CAML Builder introduction – skybow Portal article.
Web/Site placeholders will return the information from the current web or current site collection.
List parameter
-
List Name (usual name, not internal one): for lists from the current site.
I.e. [[@Web.GetFirstValueForQuery('Contacts', '<Where><BeginsWith><FieldRef Name="Title"/><Value Type="Text">Contoso</Value></BeginsWith></Where>', 'Title')]])
-
List Id (Guid): for lists from the current site.
I.e. [[@Web.QueryList ('198BBEA5-3C38-4A00-861E-0A8873905924', '<Where><BeginsWith><FieldRef Name="Title"/><Value Type="Text">[[Title]]</Value></BeginsWith></Where>' , 1, 'ID', '')]][0]["ID"]
-
Server-relative URL of the list: for any list from the current site collection.
I.e. [[@Site.GetFirstValueForQuery('/sites/Contoso/Clients/Lists/Contacts', '<Where><BeginsWith><FieldRef Name="Title"/><Value Type="Text"> [[{ return [[Title]]; }]] </Value></BeginsWith></Where>', 'Title')]]
Note 1: Current version doesn't support cross-site collection relative URLs.
Note 2: List Id or server-relative URL used in the function during publish will be automatically replaced to the correct one