Skip to main content
1-Visitor
June 16, 2022
Solved

Call the same service on each thing of a thing shape

  • June 16, 2022
  • 1 reply
  • 857 views

Hello,

 

I have a thingShape with a service that works.
I want to execute It on every thing which has this service by using a button from my mashup.

What is the simplest way of doing so?

Best answer by PaiChung

ThingShapes[NameOfThingShape].GetImplementingThings

for each item

Things[row.name].ServiceToInvoke({Parameters});

 

Something like that

Just be aware about what type of impact this could have on your system, for example if this is thousands of Things all running your service.

 

1 reply

PaiChung22-Sapphire IAnswer
22-Sapphire I
June 17, 2022

ThingShapes[NameOfThingShape].GetImplementingThings

for each item

Things[row.name].ServiceToInvoke({Parameters});

 

Something like that

Just be aware about what type of impact this could have on your system, for example if this is thousands of Things all running your service.