Skip to main content
Seasoned ⭐️⭐️⭐️
March 17, 2023
Solved

FDM - Direct Relations in Transformations

  • March 17, 2023
  • 4 replies
  • 198 views

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.

Can you please help.

Thanks,

Snehal.

    Best answer by Vu Hai Nguyen

    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.

    4 replies

    Practitioner ⭐️⭐️⭐️
    March 17, 2023

    Hi,
    Normally you can use this UDF node_reference for this.
    In your case

    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

     

    Seasoned ⭐️⭐️⭐️
    March 17, 2023

    Hi @Vu Hai Nguyen ,

    Thank you for your reply.

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

    Thanks,

    Snehal.

    Practitioner ⭐️⭐️⭐️
    March 20, 2023

    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.

    Seasoned ⭐️⭐️⭐️
    March 20, 2023

    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.