Skip to main content
Jul 10, 2019 12:48 PM UTC
Solved

Dynamic Service - Entityname Parameter

I have a service on a ThingShape. In my Mashup I connetced a selectedThing to the EntityName Parameter.

How to access this parameter in the service JS?

 

I want to reduce the number of additional input parameter, so i thought it would be "faster" to call this service dynamic and pass the thing as entityname to work with it inside the service.

 

var params = {
	identifier: undefined /* STRING */
};

// result: THINGNAME
var machine = Resources["EntityServices"].GetThingNameForIdentifier(params);

.... Code does something with machinename here.

 What is the parameter/variablename for the entityname?

BennyBAnswer
Jul 10, 2019 2:40 PM UTC

You don't need the Entityname anymore because the code is already executed on the entity, i. e. all properties etc. are available. If you still need the name you can simply get it with me.name.

2 replies

BennyBAnswer
Jul 10, 2019 2:40 PM UTC

You don't need the Entityname anymore because the code is already executed on the entity, i. e. all properties etc. are available. If you still need the name you can simply get it with me.name.

Jul 11, 2019 5:25 AM UTC

Thanks for your answer.

 

In this case I have to pass the thingname(machinenumber in my case) as parameter because from this point I pass it to a database connector thing, which needs the name for a query.

 

Many Thanks