cancel
Showing results for 
Search instead for 
Did you mean: 

How to get value based on a incoming document

the_pan_zone
New Contributor

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?

10 REPLIES 10

bojanvelevski
Valued Contributor

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}))