Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
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?
Solved! Go to Solution.
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.
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,
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.
 
					
				
				
			
		
