Skip to main content
1-Visitor
March 21, 2016
Solved

Thing template's home mashup - How to load data?

  • March 21, 2016
  • 9 replies
  • 5919 views

I have crated a Thing template (UPerson) that is used to create 5 objects. I've set the home mashup of the template to import the UPerson data dynamically and call getPropertyValues, however the method needs a link to entityName. Where do I get this from? The idea is to be able to open the home mashup of the Things implementing the Thing template and have the same layout, but different data.

Best answer by Aanjan

Try this - create a new Mashup and click on the green plus (add entity) on the right, and select your UPerson Template. Now search for the GetImplementingThings service and add that (with Mashup Loaded checked). Now, you can either bind this service to a Grid widget or a List widget based on your preference. If you are using the List widget, remember to choose a value for DisplayField and ValueField to populate the widget, or it would appear blank.

Now click on add entity once again, check dynamic, search for your UPerson Template and add the GetPropertyValues service. Since this is dynamic, it requires an EntityName input. Expand the Selected Rows(s) section on GetImplementingThings and bind the 'name' property to 'EntityName'. Click on 'GetImplementingThings' once again and bind the 'SelectedRowsChanged' event to the 'GetPropertyValues' service. You can now bind 'All Data' of GetPropertyValues to a Grid widget or so.

So when you view your mashup, based on the entity you select on the Grid or the List widget, those properties should change on the 2nd Grid. Does this make sense?

9 replies

1-Visitor
March 21, 2016

Hello,

The entityName is the name of the thing of which you want to get the properties.

This method requires the entityName because you asked it to be dynamic.

I never made a mashup for a ThingTemplate, so I can only give you some clues to Help you:

1. When you create a machup, select thingtemplate. When you click on the mashup (the root of the workspace) you will see "Entity" in the mashup parameters. This is propably where you'll get the name.

2. If it doesn't work, import your ThingTemplate service in the data section but do not choose dynamic

1-Visitor
March 21, 2016

Dragging entity from the workspace hierarchy worked. Thanks!