I am able to receive a text message into a Logic App, via a Twilio Web Hook. as set up by following these instructions
Regarding my question here Now I need to add that text into an Azure Table. I have added a Parse JSON action What should I put in the Content and Schema?
I found that if I click inside the Content Box I am prompted to pick from a tag. I guess Body is the one.
[Update] Now I am trying to insert the Entity Directly but I cant work out how to do this in the designer. How do I expand the Entity text box so as to put the JSON in?
[Update2]
I found I could expand the Entity text box by typing in it. But how do I insert the MessageText?
[Update3]
Here is how I did the Insert Entity
I was able to get a record into the Azure storage table. But where is the body of my text message?
I can see that there was a problem running
I think I need to extract a body from the Body but I don't know how
[Update4]
Show Raw Inputs displays
{
"host": {
"connection": {
"name": "/subscriptions/somenumbers/resourceGroups/mydomain.com.au/providers/Microsoft.Web/connections/azuretables"
}
},
"method": "post",
"path": "/Tables/TextMessages/entities",
"body": {
"Message": {
"$content-type": "application/x-www-form-urlencoded",
"$content": "VG9Db3VudHJ5PUFVJlRvU3RhdGU9JlNtc01lc3NhZ2VTaWQ9U000MTU4YzU1YmVkNDNjZDFiNWZmMTNiODZiNjIyNzkyNSZOdW1NZWRpYT0wJlRvQ2l0eT0mRnJvbVppcD0mU21zU2lkPVNNNDE1OGM1NWJlZDQzY2QxYjVmZjEzYjg2YjYyMjc5MjUmRnJvbVN0YXRlPSZTbXNTdGF0dXM9cmVjZWl2ZWQmRnJvbUNpdHk9JkJvZHk9VGFrZSsyJkZyb21Db3VudHJ5PUFVJlRvPSUyQjYxNDQ3NDA1NjEzJlRvWmlwPSZOdW1TZWdtZW50cz0xJk1lc3NhZ2VTaWQ9U000MTU4YzU1YmVkNDNjZDFiNWZmMTNiODZiNjIyNzkyNSZBY2NvdW50U2lkPUFDN2FhZTMxM2UwZmRlOGVkZjE5YzhjMGY5NjQ1MTgwNjYmRnJvbT0lMkI2MTQxOTU3NTQxNSZBcGlWZXJzaW9uPTIwMTAtMDQtMDE=",
"$formdata": [
{
"key": "ToCountry",
"value": "AU"
},
{
"key": "ToState",
"value": ""
},
{
"key": "SmsMessageSid",
"value": "SM4158c55bed43cd1b5ff13b86b6227925"
},
{
"key": "NumMedia",
"value": "0"
},
{
"key": "ToCity",
"value": ""
},
{
"key": "FromZip",
"value": ""
},
{
"key": "SmsSid",
"value": "SM4158c55bed43cd1b5ff13b86b6227925"
},
{
"key": "FromState",
"value": ""
},
{
"key": "SmsStatus",
"value": "received"
},
{
"key": "FromCity",
"value": ""
},
{
"key": "Body",
"value": "Take 2"
},
{
"key": "FromCountry",
"value": "AU"
},
{
"key": "To",
"value": "+61447405613"
},
{
"key": "ToZip",
"value": ""
},
{
"key": "NumSegments",
"value": "1"
},
{
"key": "MessageSid",
"value": "SM4158c55bed43cd1b5ff13b86b6227925"
},
{
"key": "AccountSid",
"value": "AC7aae313e0fde8edf19c8c0f964518066"
},
{
"key": "From",
"value": "+61419575415"
},
{
"key": "ApiVersion",
"value": "2010-04-01"
}
]
},
"PartitionKey": "Twilio",
"RowKey": "1d5a06ca-9dbd-4ba9-b514-77904710ffc3"
}
}
[Update5]
I think I need to know how to get the body property out of @triggerBody()
[Update6]
I tried
"body": {
"Message": "@triggerBody()['Body']",
"PartitionKey": "Twilio",
"RowKey": "@guid()"
}
but this causes an error
ie
InvalidTemplate. Unable to process template language expressions in action 'Insert_Entity' inputs at line '1' and column '1450': 'The template language expression 'triggerBody()['Body']' cannot be evaluated because property 'Body' doesn't exist. Property selection is not supported on content of type 'application/x-www-form-urlencoded'. Please see https://aka.ms/logicexpressions for usage details.'.
[Update7]
I am changing the HTTPRequest body to use JSON Schema
"$content-type": "application/json",
instead of
"$content-type": "application/x-www-form-urlencoded",
[Later note] I did this because Azure displayed a warning message "Remember to include a Content-Type header set to application/json in your request" However it seems to work either way.
[Update8]
I was able to receive the message in Azure when I used
"Message": "@triggerFormDataValue('Body')"