cancel
Showing results for 
Search instead for 
Did you mean: 

workflow script with query

archiee
Champ in-the-making
Champ in-the-making
hello everyone.

I'm an Alfresco newby and I'm working on community 4.2e.

I'm currently working on an Activity workflow in which I have to perform queries on custom properties I added on user profile.
I performed user customization following this Jeff Potts tutorial (god bless you): http://ecmarchitect.com/archives/2012/02/27/1555

Now, my problem.

Currently I'm performing this kind of search:

<javascript>
var def =
{
query: "@scp:NameOfTheCustomProperty:TextToSearch",
language: "fts-alfresco"
};
var nodes = search.query(def);
</javascript>

which works fine.

What I don't know how to do is the way I can substitute my "TextToSearch" with the content of a previously set variable.

Something like replacing:
<javascript>
query: "@scp:NameOfTheCustomProperty:TextToSearch",
</javascript>
with:
<javascript>
query: "@scp:NameOfTheCustomProperty:ContentOfVariableNamedXXX",
</javascript>
Thank you in advance for your help.

Best regards,

Archie
2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator
query:  '@scp\:NameOfTheCustomProperty:' + ContentOfVariableNamedXXX ; //for term query‍


query:  '@scp\:NameOfTheCustomProperty:"' + ContentOfVariableNamedXXX + '"'; //for phrase query‍

archiee
Champ in-the-making
Champ in-the-making
Thank you so much, kaynezhang.
It works fine.
Welcome to the new Hyland Connect. Get started or submit feedback.