01-22-2024 03:41 AM
Input Structure
[
{
"Id": "ABC",
"IFA_Number__c": "1"
},
{
"Id": "BCD",
"IFA_Number__c": "2"
}
]
I have to save this data in a key value format ( Ifanumber is key and ID is value) so that later in mapper I have to fetc fetch the respective ID based on IFA number. what's best way to do this?
Solved! Go to Solution.
01-23-2024 12:35 AM
Hello @akarsh,
You can try with grouping all of the documents into a single array, then using reduce to combine them in one object.
Please note that if you have duplicate keys through the documents, they will overwrite.
Please refer to the attached pipeline and let me know if this helps you.
Regards,
Aleksandar.
01-30-2024 12:51 AM
You can try with the following expression:
$dataList.map(x => x.get('IfaNumber',null)).filter((x,ind,arr) => x != null && arr.indexOf(x) == ind)
Let me know if this helps.
Regards,
Aleksandar.
01-30-2024 12:59 AM
Thank you , Thank you. I really appreciate your help. I know I ate your head a lot. Thanks once again 🙂
01-30-2024 01:03 AM
No worries! Glad to be of help, that's what this community is all about! 🙂