Forum Discussion

bcole's avatar
bcole
New Contributor
3 years ago

How to add a property name to my incoming Array

How to I add a property name to my incoming array: Looks this way:
[{
“fileName”: “Invoice.pdf”,
“filePath”: “\\Server01\FileFolder\12575\773016951\6b83566e-0908-42f9-9bbe-9adefb296633”
},
{
“fileName”: “Invoice2.pdf”,
“filePath”: “\\Server01\FileFolder\12575\773016951\6b83566e-0908-42f9-9bbe-adefb296633”
}
]
I need it to look like the following after transformation:
“Document”: {
“Documents”: [{
“fileName”: “Invoice.pdf”,
“filePath”: “\\Server01\FileFolder\12575\773016951\6b83566e-0908-42f9-9bbe-9adefb296633”
},
{

            "fileName": "Invoice2.pdf",
            "filePath": "\\\\Server01\\FileFolder\\12575\\773016951\\6b83566e-0908-42f9-9bbe-9adefb296633"
        }
    ]
}

}
How do I accomplish that?