Solved

# FDM - Direct Relations in Transformations

• 4 replies
• 68 views

• Committed
• 3 replies

Hi Team,

I am trying to populate FDM data model using Transformation.

I am using direct relationship in my model. Let say EntityRelationship View has two fields to and From which referes to Entity view.

These fields are coming as Struct<String,String> as destination type intransformation.

I was trying to add Space:externalId in this field. However it is giving Incompatible type error.

Thanks,

Snehal.

icon

Best answer by Vu Hai Nguyen 20 March 2023, 09:36

View original

### 4 replies

Userlevel 1

Hi,
Normally you can use this UDF node_reference for this.

node_reference(‘sj-test-data-model’, cast(TO_ITEM_ID as STRING) as fromentity

If that doesn’t work you can try

named_struct("spaceExternalId", "sj-test-data-model", "externalId", cast(TO_ITEM_ID as STRING)) as fromentity

Hi @Vu Hai Nguyen ,

I tried both way, it is still showing as invalid type

Thanks,

Snehal.

Userlevel 1

Hi,

There’s a bug that we need to fix when validating data for direct relation property, can you try to run the transformation in both way to see? The node_reference should work.

Hi @Vu Hai Nguyen

I tried running transformation directly ignoring the warning and was able to run it successfully with both ways.

Thanks a lot for help!

Thanks,

Snehal.