Skip to main content
1-Visitor
July 5, 2016
Question

Mashup. Set Properties to all things

  • July 5, 2016
  • 5 replies
  • 3616 views

All the mashups I've done so far were about one thing so if I wanted to set a property's value I used

Add dynamic template -->Set Property and then I could set property to each thing.

My problem, now, is that I want to set a property value to ALL things (i.e. I have a minimum temperature property and I want it to change to all things).

I don't understand how to do it

5 replies

20-Turquoise
July 5, 2016

One thing to go around the issue would be writing a service that would update/set property to all things. Are they all sharing one template? If so, if the template also shares the property, you may write a service using "set property()" snippet and update all things from within that service. If they are not sharing the template/property, then the service might be a bit more complicate but with a similar logic.

Once the service code is defined, you'll go the same route with actually using the service from the mashup as in just having one thing to update.

fmanniti1-VisitorAuthor
1-Visitor
July 6, 2016

Ok, I'm still learning how to write services.

All my things are under the same template and they all inherit the same properties from the template.

I tried "Add my service" and I guess I must set "NOTHING" as output. But I cannot find "set property()" in snippets. I didn't understand if it is written under another name or you meant it's a function I have to make by myself

20-Turquoise
July 6, 2016

You may set nothing as the output or some result to test the function before using it in the mashup. Please see below for SetPropertyValue function that is built-in in the Thing entities and "Me" (used fot the Thing Template):

1-Visitor
July 7, 2016

You can find a solution here UpdatePropertyValues service