{{velocity}}
#set ($className = 'YourAWMClass') # Replace with your actual AWM class name
#set ($propertyName = 'Title') # Replace with your actual property name
#set ($propertyValue = 'VALUEfromAWMDATA') # Replace with the value you're looking for
#set ($query = "from doc.object(${className}) as obj where obj.${propertyName} = :value")
#set ($count = $services.query.xwql($query).bindValue('value', $propertyValue).execute().size())
$count Pages with $propertyValue
{{/velocity}}
Alternatively, instead of setting className and propertyName with their values as separated variables, you can combine them into one query statement. Depends on your preferences and whether are you planning to change query afterward.
There is a problem with some “-” in my class name. It is something like this:
Page.Your-AWM-App.Code.Your-AWM-AppClass
ChatGPT found out that I shout use additional ‘’ in doc.object('${className}')
What finally worked was:
{{velocity}}
#set ($className = 'YourAWMClass') # Replace with your actual AWM class name
#set ($propertyName = 'Title') # Replace with your actual property name
#set ($propertyValue = 'VALUEfromAWMDATA') # Replace with the value you're looking for
#set ($query = "from doc.object('${className}') as obj where obj.${propertyName} = :value")
#set ($count = $services.query.xwql($query).bindValue('value', $propertyValue).execute().size())
$count Pages with $propertyValue
{{/velocity}}