Share via

Logic Apps: Invalid Request using output from SQL Get Row / Webhook

AFWright 21 Reputation points
2021-08-27T00:28:44.973+00:00

Getting The following Error Message for an app with an HTTP trigger :

"InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_(V2)' inputs at line '1' and column '1896': 'The template language expression 'body('Vendor')['username']' cannot be evaluated because property 'username' doesn't exist, available properties are '@odata.context, value'. Please see https://aka.ms/logicexpressions for usage details.'."

GetRow Output is as follows:

{
"@odata.context": "https://logic-apis-northcentralus.azure-apim.net/",
"value": [
{
"@odata.etag": "",
"ItemInternalId": "b377fb05-ccdc-4d44-b8a1-a58278b5a304",
"vendorname": "Nexus ",
"currency": "Test",
"companyname": "Nexus",
"nameoncheck": "Test",
"terms": "Test",
"firstname": "Test",
"lastname": "Test",
"phone": "Test",
"email": "Test",
"firstname2": "Test",
"lastname2": "Test",
"phone2": "Test",
"email2": "Test",
"logfirstname": "Test",
"loglastname": "Test",
"logphone": "Test",
"loggemail": "Test",
"finfirstname": "Test",
"finlastname": "Test",
"finphone": "Test",
"finemail": "Test",
"notes": "Hello",
"addr1": "Test",
"addr2": "Test",
"addr3": "Test",
"city": "Test",
"state": "Test",
"zip": "Test",
"country": "Test",
"shipaddr1": "Test",
"shipaddr2": "Test",
"shipcity": "Test",
"shipstate": "Test",
"shipzip": "Test",
"shipcountry": "Test",
"direct": "True",
"contact": "email",
"wine": "True",
"spirits": "False",
"na": "False",
"timestamp": "2021-08-26T23:36:38.6800000",
"listid": "Pending",
"username": "email",
"id": 1
}
]
}

Any insight would be appreciated. Thank you.

Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.

0 comments No comments

Answer accepted by question author

MayankBargali-MSFT 71,016 Reputation points Moderator
2021-08-27T05:49:51.977+00:00

@AFWright In your output I can see your output have the json value which has array of value.
So to get the value for username field you need to define the postion for which you want to retrive the value in array.

For testing I have used your json output and define it in the string variable and used the output of the string variable to get the username field. I have converted the string to array first then get the first element of value and then get the username value. You can refer to functions in expressions for Azure Logic Apps for different expression that are supported.

json(variables('myData')).value[0].username

So according to your requirement to can iterate through the array list to get the desire output.

127027-image.png

127043-image.png

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.