Reputation: 11
So l am trying to extract json file from an email attachment.
I then l try to parse json the file but don't get the content of the json file itself.
What l want to then do is assign the first and last name to a variable and use that later on in the logic app.
I have used a combination of the following for the content in the json control :
base64(triggerBody()?['attachments']?['ContentBytes'])
base64ToString(body('Getattachment')?['attachments']?['ContentBytes'])
but keep the following message :
Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'The template language expression 'body('GetAttachment')?['Attachments'][0]?['ContentBytes']' cannot be evaluated because property '0' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.
Upvotes: 0
Views: 181
Reputation: 11363
It worked for me using below design:
base64ToString(body('Get_Attachment_(V2)')?['contentBytes'])
Input attachment:
{
"firstName":"Rithwik",
"lastName":"Bojja"
}
Output:
Upvotes: 0