Want to iterate CDT (list) and copy to the new CDT as MAP (like key(i.e. text),value (i.e. list of CDT)pair)

Hi,

 

List 1 (input list) - multiple wells per each AMU (PFA screen shots 3 for Big gully , 5 for Rush Lake etc)

     

I want loop each item in the list and group the wells associated to each well and each amu has different groups/users created in Appian . For each AMU , an email notification needs to send to all the associated distinct users along with the well details in a table format.

So I have created a CDT as below or the result CDT should contain distinct  AMU with Well list and its user details

 

Can some one help me to achieve this logic.

 

 

Thanks

Soujanya

  Discussion posts and replies are publicly visible

Parents
  • Hi Soujanya,
    By analysing your cdt and data i am assuming that you want to set the details of WellList with associate AMU's
    to do so first get the distinct AMUNames from the dictionary by using
    distinct(index(cdt,"AMU",{}),index(cdt,"AMU",{})) by this you will get the distinct AMUNames
    after getting distinct AMUNames do forEach,
    follow the example code :
    load(
    local!distinctAMUNames: distinct(index(cdt,"AMU",{}),index(cdt,"AMU",{}))
    forEach(
    items: local!distinctAMUNames,
    expression: with(
    local!currentAMUs: fv!item,
    type!RTRR_HOG_LEG_BY_AMU(
    AMUNames :local!currentAMUs,
    wellList: forEach(
    items:index(yourCDT, wherecontains( local!currentAMUs,index(yourCDT,"AMU",{})),{}),
    expression: type!WellList(
    WellName : index(fv!item,"wellName",null),
    UWI : index(fv!item,"wellName",null),
    userList : /* Your code */
    )
    )
    )
    )

    )
    )
  • 0
    A Score Level 1
    in reply to Sachin
    Try union function in place of distinct
Reply Children
No Data