Details
- 
        Type:
Monitor
 - 
        Status: Closed
 - 
            Priority:
 Major
                
             - 
            Resolution: Done
 - 
            Affects Version/s: None
 - 
            Fix Version/s: 2021
 - 
            Component/s: FIWARE-TECH-HELP
 - 
            Labels:
 
- 
                        HD-Chapter:Apps
 - 
                        HD-Enabler:Wirecloud
 
Description
Created question in FIWARE Q/A platform on 25-01-2017 at 02:01
Please, ANSWER this question AT https://stackoverflow.com/questions/41841914/ngsi-update-attributes-from-complex-entities-in-wirecloud
Question:
NGSI update attributes from complex entities in Wirecloud
Description:
Is it possible to update a child attribute through the updateAttributes() function from Wirecloud NGSI API?
For example, a coordinate (entity.location.coords.coordinates[0]=-2.000000) in this piece of entity.
   "attrNames": [ "A1", "A2", "position" ],
   "creDate": 1389376081,
   "modDate": 1389376244,
   "location": {
       "attrName": "position",
       "coords": 
EDITED
My own answer: It is possible by passing an object as value of the attribute.
ngsi.updateAttributes([
                    {
                        'entity': 
,
                        'attributes':[{ 
                          "name":"location","contextValue": {
                               "attrName": "position",
                               "coords": 
                          } 
                        }]  
                    }
                ], 
);
However, Wirecloud is using NGSI API v1, therefore all attributes are treated as strings when they are sent/received to/from Orion.
More info: http://fiware-orion.readthedocs.io/en/master/user/structured_attribute_valued/
Activity
| Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
|---|---|---|---|---|---|---|---|---|---|
		    	
  | 
			2h 58m | 1 | Backlog Manager | 22/May/17 6:04 PM | |||||
		    	
  | 
			2h 59m | 1 | Backlog Manager | 22/May/17 9:04 PM | |||||
		    	
  | 
			6d 17h 45m | 1 | José Ignacio Carretero Guarde | 29/May/17 2:50 PM |