How do I add an SMS from Twilio into Azure Table Storage using Logic App

女生的网名这么多〃 提交于 2019-12-01 14:32:18

According to the commment, I update the answer.

If we want to insert an message to Azure table, we could contruct the table entity by inputing the json format directly. More detail please refer to the demo code and screenshot.

Note :PartionKey and Rowkey is requred for Azure table entity.

{
 "Message": "@triggerFormDataValue('Body')",
 "PartitionKey": "Twilio",
 "RowKey": "@guid()"
}

You can also do this using just Logic App actions.

You can use the Parse JSON data operation to parse the JSON coming from your Twilio response. The "Body" of your Twilio response becomes the Content for the Parse JSON action as you mention in your question.

To generate a schema for the Schema field you can click on the "Use sample payload to generate schema" link. Paste in the JSON payload you are expecting back in the Twilio response, for example:

    {
        "message: "A message from twilio"
    }

You can then use the results of the Parse JSON action to populate Azure Table Storage.

Message can be populated from the Parse JSON action; Partition Key can be hard-coded; RowKey can be calculated based on an Expression - @guid().

one thing to note here is the content type of a Twilio webhook is not application/json, so you can't use parse JSON. It is application/x-www-url-formencoded. You can still parse it out, but needs to be with an expression. If you open the expression editor, getting the body of the text would be something like:

triggerFormDataValue('Body')

The FROM phone number would be

triggerFormDataValue('From')

You can see in the outputs of the trigger the different form pieces.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!