Parse text in Azure Logic Apps Parse text in Azure Logic Apps azure azure

Parse text in Azure Logic Apps


I've managed to solve my problem with use of Workflow Definition Language and building blocks provided by Azure.

The Azure Function idea was not that bad and would fit perfectly for any more complex case, but as I mentioned, I wanted it as simple as possible, so here it is.

This is how my flow looks now.

For sake of completeness, here is the flow in JSON format

{    "$connections": {        "value": {            "wunderlist": {                "connectionId": "/subscriptions/.../providers/Microsoft.Web/connections/wunderlist",                "connectionName": "wunderlist",                "id": "/subscriptions/.../providers/Microsoft.Web/locations/northeurope/managedApis/wunderlist"            }        }    },    "definition": {        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",        "actions": {            "Condition": {                "actions": {                    "Create_a_task": {                        "inputs": {                            "body": {                                "completed": false,                                "list_id": 000000000,                                "starred": true,                                "title": "@{variables('today date')}"                            },                            "host": {                                "connection": {                                    "name": "@parameters('$connections')['wunderlist']['connectionId']"                                }                            },                            "method": "post",                            "path": "/tasks",                            "retryPolicy": {                                "type": "none"                            }                        },                        "limit": {                            "timeout": "PT20S"                        },                        "runAfter": {},                        "type": "ApiConnection"                    },                    "Set_a_reminder": {                        "inputs": {                            "body": {                                "date": "@{addHours(utcNow(), 3)}",                                "list_id": 000000,                                "task_id": "@body('Create_a_task')?.id"                            },                            "host": {                                "connection": {                                    "name": "@parameters('$connections')['wunderlist']['connectionId']"                                }                            },                            "method": "post",                            "path": "/reminders",                            "retryPolicy": {                                "type": "none"                            }                        },                        "limit": {                            "timeout": "PT20S"                        },                        "runAfter": {                            "Create_a_task": [                                "Succeeded"                            ]                        },                        "type": "ApiConnection"                    }                },                "expression": "@contains(body('HTTP'), variables('today date'))",                "runAfter": {                    "Initialize_variable": [                        "Succeeded"                    ]                },                "type": "If"            },            "HTTP": {                "inputs": {                    "method": "GET",                    "uri": "..."                },                "runAfter": {},                "type": "Http"            },            "Initialize_variable": {                "inputs": {                    "variables": [                        {                            "name": "today date",                            "type": "String",                            "value": "@{utcNow('yyyy/MM/dd')}"                        }                    ]                },                "runAfter": {                    "HTTP": [                        "Succeeded"                    ]                },                "type": "InitializeVariable"            }        },        "contentVersion": "1.0.0.0",        "outputs": {},        "parameters": {            "$connections": {                "defaultValue": {},                "type": "Object"            }        },        "triggers": {            "Recurrence": {                "recurrence": {                    "frequency": "Day",                    "interval": 1,                    "startTime": "2017-08-01T23:55:00Z",                    "timeZone": "UTC"                },                "type": "Recurrence"            }        }    }}


You can use inline code action in logic app to run javascript regex code (preview- May 2019) (Not supported on Flow).

Iniline Code

Logic App Inline Code Ref


You're probably on the right track. An Azure Function would be the most appropriate way to implement this right now. An API App is an option but that's a heavier platform than you need.