Hi, I have a webhook returning something as:
I´d like to get the DOCUMENT_ID and DOCUMENTNAME after I collect the COMPANY_ID
I am using the next code to get the and save in a variable, but I get no look:
data.Database.filter((el) => el.COMPANY_ID == {{ r_menu_sel_clube }}).flatMap((item) => item.COMPANYDOCS.flatMap((doc) => doc.DOCUMENT_ID + "-" + doc.DOCUMENTNAME))
{
"Database": [
{
"ASSOCIADO_ID": 2494,
"COMPANY_ID": 5,
"COMPANYDOCS": [
{
"LINE": 1,
"DOCUMENT_ID": 43,
"DOCUMENTNAME": "Declaração LALAL"
},
{
"LINE": 2,
"DOCUMENT_ID": 11,
"DOCUMENTNAME": "Declaração PAPAP"
},
]
},
{
"ASSOCIADO_ID": 14297,
"COMPANY_ID": 6,
"COMPANYDOCS": [
{
"LINE": 1,
"DOCUMENT_ID": 43,
"DOCUMENTNAME": "Declaração AA"
},
{
"LINE": 2,
"DOCUMENT_ID": 11,
"DOCUMENTNAME": "Declaração CC"
},
]
},
]
}
Add a reply
Sign up and join the conversation on Discord