cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Does anyone know how to use Resources["SearchFunctions"].SearchPeople in ThingWorx?

liliu
12-Amethyst

Does anyone know how to use Resources["SearchFunctions"].SearchPeople in ThingWorx?

Does anyone know how to use Resources["SearchFunctions"].SearchPeople in ThingWorx?

ACCEPTED SOLUTION

Accepted Solutions

var params = {
maxItems: undefined /* NUMBER */,
searchExpression: "El*",
modelTags: undefined /* TAGS */,
query: undefined /* QUERY */,
aspects: undefined /* JSON */,
excludedAspects: undefined /* JSON */,
maxSearchItems: undefined /* NUMBER */
};

// result: INFOTABLE dataShape: SearchResults
var result = Resources["SearchFunctions"].SearchPeople(params).peopleResults;

View solution in original post

6 REPLIES 6

What does you mean on how it works?

 

You have a snippet to use it, just on the snippets write SeachPeople and it will pop the SearchPeople snippet if you mouse over you have an explanation of each parameter.

 

 

liliu
12-Amethyst
(To:CarlesColl)

Hi Carles,

 

I know this function can be copied from snippets. However, I don't know how to set the parameters for this function.

 

var params = {
maxItems: undefined /* NUMBER */,
searchExpression: undefined /* STRING */,
modelTags: undefined /* TAGS */,
query: undefined /* QUERY */,
aspects: undefined /* JSON */,
excludedAspects: undefined /* JSON */,
maxSearchItems: undefined /* NUMBER */
};

// result: INFOTABLE dataShape: SearchResults
var result = Resources["SearchFunctions"].SearchPeople(params);

 

Since I don't know it's searching result, I don't know how to set the parameters.

Could you please give me a sample?

 

Best Regards,

Olivia

But what you are trying to query for?

liliu
12-Amethyst
(To:CarlesColl)

Hi Carles,

 

Like username started with "El"

 

Best Regards,

Olivia

var params = {
maxItems: undefined /* NUMBER */,
searchExpression: "El*",
modelTags: undefined /* TAGS */,
query: undefined /* QUERY */,
aspects: undefined /* JSON */,
excludedAspects: undefined /* JSON */,
maxSearchItems: undefined /* NUMBER */
};

// result: INFOTABLE dataShape: SearchResults
var result = Resources["SearchFunctions"].SearchPeople(params).peopleResults;

Leigh
Emeritus
(To:liliu)

Hi @liliu

Just wanted to follow up to see if Carles's response answered your question.  If so, please indicate Accepted Solution for the rest of the Community's benefit.  If not, please advise on current status.

Thanks!

Leigh

Announcements


Top Tags