none
React to changes in SharePoint List and forward item by mail RRS feed

  • Question

  • Hi,

    I created an Azure Logic App to process changes in a SharePoint list. When an item is modified, a email should be sent to a defined address.

    So it seems to work, the event is triggered, when item was modified and the next step - sending the mail starts, too. But there seems to be no data in the object, which comes from SP, so the ID placeholder from the previous step stays empty.

    Here is some code from my simple app, may someone help me with my issue?

    {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Send_an_email": {
                "inputs": {
                    "body": {
                        "Body": "item added: @{item()?['ID']}",
                        "Subject": "new item added",
                        "To": "mail@mail.de"
                    },
                    "host": {
                        "api": {
                            "runtimeUrl": "https://logic-apis-northcentralus.azure-apim.net/apim/office365"
                        },
                        "connection": {
                            "name": "@parameters('$connections')['office365']['connectionId']"
                        }
                    },
                    "method": "post",
                    "path": "/Mail"
                },
                "runAfter": {},
                "type": "ApiConnection"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "When_an_existing_item_is_modified": {
                "inputs": {
                    "host": {
                        "api": {
                            "runtimeUrl": "https://logic-apis-northcentralus.azure-apim.net/apim/sharepointonline"
                        },
                        "connection": {
                            "name": "@parameters('$connections')['sharepointonline']['connectionId']"
                        }
                    },
                    "method": "get",
                    "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://MYTENANT.sharepoint.com'))}/tables/@{encodeURIComponent(encodeURIComponent('212d090d-5694-4176-82ce-dcbd89c22787'))}/onupdateditems"
                },
                "recurrence": {
                    "frequency": "Minute",
                    "interval": 3
                },
                "splitOn": "@triggerBody()?.value",
                "type": "ApiConnection"
            }
        }
    }



    • Edited by htred Wednesday, August 31, 2016 7:08 AM typo
    Wednesday, August 31, 2016 7:03 AM

Answers

  • Hi mate,

      Did you try to change your splitOn to @triggerBody()?['value'] ?

      Maybe this is the issue.

    Cheers, Wagner,

    • Marked as answer by htred Friday, September 2, 2016 1:59 PM
    Wednesday, August 31, 2016 9:58 AM

All replies

  • Hi mate,

      Did you try to change your splitOn to @triggerBody()?['value'] ?

      Maybe this is the issue.

    Cheers, Wagner,

    • Marked as answer by htred Friday, September 2, 2016 1:59 PM
    Wednesday, August 31, 2016 9:58 AM
  • Thank you, that fixed it! Seems a bit confusing for me, cause this was the generated code.
    Friday, September 2, 2016 1:59 PM
  • I can't remember when splitOn was implemented, but this format "body('action').field" is the old format, where the new format is "body('action')['field']".

    I think there might still be gaps in the documentation - and potentially in some connectors.

    If you find some of those, I think the product team will be interested to hear about - they are quite active on Twitter and here as well, plus I think you can report those to logicappsbug@microsoft.com.

    Cheers, Wagner.

    Saturday, September 3, 2016 2:43 PM