REST API: DimensionElementComponentAdd

Post Reply
Dimix
Posts: 32
Joined: Fri Jan 15, 2016 2:53 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

REST API: DimensionElementComponentAdd

Post by Dimix »

Hi

I'm using the REST API to create a dimension hierarchy.

I'm using below syntax to connect an element to a consolidated node, which works as expected.

Body: {"Element":{"Name": "New Element", "UniqueName":"[plan_business_unit].[New Element]"}}
POST: Dimensions('plan_business_unit')/Hierarchies('plan_business_unit')/Elements('Consolidation1')/tm1.SetComponent

My issue is if I want to add the same element to a second consolidated node, i.e.:

Body: {"Element":{"Name": "New Element", "UniqueName":"[plan_business_unit].[New Element]"}}
POST: Dimensions('plan_business_unit')/Hierarchies('plan_business_unit')/Elements('Consolidation2')/tm1.SetComponent

I'm getting this error message:

Capture.PNG
Capture.PNG (4.93 KiB) Viewed 2310 times

How can I connect an element to more than one node?
Dimix
Posts: 32
Joined: Fri Jan 15, 2016 2:53 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: REST API: DimensionElementComponentAdd

Post by Dimix »

Found the answer:

Body: {"Element@odata.bind": "Dimensions('plan_business_unit')/Hierarchies('plan_business_unit')/Elements('New Element')}​​
POST: Dimensions('plan_business_unit')/Hierarchies('plan_business_unit')/Elements('Consolidation2')/tm1.SetComponent

Found it here:
https://www.ibm.com/developerworks/comm ... operations
Post Reply