Skip to main content
1-Visitor
July 10, 2019
Solved

Dynamic Service - Entityname Parameter

  • July 10, 2019
  • 2 replies
  • 1931 views

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?

Best answer by BennyB

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

BennyB16-PearlAnswer
16-Pearl
July 10, 2019

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.

1-Visitor
July 11, 2019

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