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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Translate the entire conversation x

Things is not defined.

Socka_HW
7-Bedrock

Things is not defined.

In an Expressions function: ExistentPTO in a Mashup X,

I have a need to evaluate the payload on a call to a route (from another project: ToolB).

response = Things["ToolB.v6DocMgmt"].getDocuments({

...

...

});

if (JSON.stringify(response)[value] == []) {

    output = "Not a good number";

} else output = <target mashup name>;

 

When viewing the mashup, i get this in the logs:

19:06:28 WARN - Evaluation of expression "ExistentPTO" Failed. Things is not defined

 

Can I NOT use Things within an Expression function? How do i refer to a Thing in another project?

 

 

ACCEPTED SOLUTION

Accepted Solutions
Ascherer17
15-Moonstone
(To:Socka_HW)

Expressions are executed on the "client" side (the user's browser) meaning you only have access to Expression inputs that you feed in and some items that are part of the browser. Whereas Services (defined on a Thing) run on the actual Thingworx server, so they can access your Thingworx model.

 

It sounds like you may want to create a Service to perform the desired function and call it from your mashup.

View solution in original post

3 REPLIES 3

Hi @Socka_HW 

Thank you for your question. 

Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Also, feel free to add any additional information you think might be relevant. It sometimes helps to have screenshots to better understand what you are trying to do.

 

Best regards,


Catalina
PTC Community Moderator
PTC
Ascherer17
15-Moonstone
(To:Socka_HW)

Expressions are executed on the "client" side (the user's browser) meaning you only have access to Expression inputs that you feed in and some items that are part of the browser. Whereas Services (defined on a Thing) run on the actual Thingworx server, so they can access your Thingworx model.

 

It sounds like you may want to create a Service to perform the desired function and call it from your mashup.

I created a Service (with the desired functionality) and called it from my Mashup..
All is well ... 

 

thank you.

Announcements
Top Tags