12-01-2021 03:45 AM
Hi, I have the below input data
AccountName,AccountID,PAccountID
Abc,5467,6000
dsd,6000,7000
dfghyh,7000,5467
In the output I want the Parent account name based on the input so the output will be like
AccountName,AccountID,PAccountID, PAccountName
Abc,5467,6000,dsd
dsd,6000,7000,dfghyh
dfghyh,7000,5467,Abc
Please help me how can I achieve that?
12-02-2021 08:26 AM
Update the expression:
$input0.map((x,index)=> x.PAccountID == null || x.PAccountID == "" || x.PAccountID == "null" ? x : x.extend({"PAccountName":$input0.filter(y=>y.AccountID == x.PAccountID)[0].AccountName}))