Solved

Tranformation example for multiple links

  • 6 December 2022
  • 1 reply
  • 59 views

Userlevel 3
Badge

Hi could you share an example of a transformation to load a type that has multiple links to another type? All the examples I’ve seen only set startNode and endNode but no place to specify which field. For example:

type Composite {

   frontPart: Part

   backPart: Part

}

type Part {

  ...

}

icon

Best answer by Anders Hafreager 6 December 2022, 09:39

View original

1 reply

Userlevel 3

Hi,

When you have two fields with the same target type, you would do exactly as if you have a single property. This is a part we have yet not put in the docs (coming very soon!), but the UI would help you create this transformation. But to also answer your question, assuming you have a RAW table with the columns frontPart, backPart and externalId (the first two would be external ids to the Part instances)

Select 
  array("datamodelexternalId", `frontPart`) as `frontPart`,
  array("datamodelexternalId", `backPart`) as `backPart`,
  string(`externalId`) as `externalId`
from `database`.`table`;

 

Reply