How to map CDT

Certified Associate Developer

Hello,

 

I have a requirement where I need to map data in one CDT to another. The two CDT's are as below

 

DS_SeparatedData which includes FieldIdentifier,DataValue,Datacaption and Keyidentifier - These values are coming from database, Now what I want is I want to map the value of FieldIdentifier and DattaValue manually from another variable. So my another variable would be: VD_SeparatedData which includes FieldIdentifier and DataValue. As per the value available in VD_SeparatedData variable, I want to update the value in DS_SeparatedData. for eg:

 Lets say my DS_SeparatedData consists of following value. i.e.

DS_SeparatedData

         FieldIdentifier:"Email"

         DataValue:abc@abc.com

         Datacaption: "Email ID"

        KeyIdentifier:2

 

VD_SeparatedData

       FieldIdentifier:"Email"

       DataValue:pqr@xyz.com

 

So I want DataValue in VD_SeparatedData variable to get updated in DS_SeparatedData as FieldIdentifier is same on both the variable. 

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to mohamedt808
    a!forEach(
    items:ri!SeparatedData_CDT,
    expression:{'type!{urn:com:appian:types}WebLaunchParameters'(
    ProcessDataCaption: ri!SeparatedData_CDT[fv!index].ProcessDataCaption,
    FieldIdentifier: ri!SeparatedData_CDT[fv!index].FieldIdentifier,
    ProcessDataLaunch: ri!SeparatedData_CDT[fv!index].ProcessDataLaunch,
    ProcessDataOptional: ri!SeparatedData_CDT[fv!index].ProcessDataOptional,
    ProcessDataValue: index(ri!VD_Datasubset,wherecontains(ri!SeparatedData_CDT[fv!index].FieldIdentifier,ri!VD_Datasubset.FieldIdentifier),""),
    KeyFormAttributeType: ri!SeparatedData_CDT[fv!index].KeyFormAttributeType,
    FormAttributeValue: ri!SeparatedData_CDT[fv!index].FormAttributeValue
    )}
    )
  • Try this ,


    a!forEach(
    items:ri!SeparatedData_CDT,
    expression:{'type!{urn:com:appian:types}WebLaunchParameters'(
    ProcessDataCaption: ri!SeparatedData_CDT[fv!index].ProcessDataCaption,
    FieldIdentifier: ri!SeparatedData_CDT[fv!index].FieldIdentifier,
    ProcessDataLaunch: ri!SeparatedData_CDT[fv!index].ProcessDataLaunch,
    ProcessDataOptional: ri!SeparatedData_CDT[fv!index].ProcessDataOptional,
    ProcessDataValue: index(ri!VD_Datasubset.ProcessDataValue,wherecontains(ri!SeparatedData_CDT[fv!index].FieldIdentifier,ri!VD_Datasubset.FieldIdentifier),""),
    KeyFormAttributeType: ri!SeparatedData_CDT[fv!index].KeyFormAttributeType,
    FormAttributeValue: ri!SeparatedData_CDT[fv!index].FormAttributeValue
    )}
    )
  • 0
    Certified Associate Developer
    in reply to mohamedt808
    Thanks Mohamed, It worked. I really appreciate your time and efforts. Thank you once again :)