H Bala
H Bala

Reputation: 1321

Logic Apps trigger do not succeed if folder dont exist

Azure Logic apps trigger (Box) to (FTP) succeeds only when the folder pre-exists. As I refer in the Logic Apps API, trigger is around files and not folders. Would there be any workaround.

========================== Updated below ===========================

What I was trying to is to get a watch on a parent folder, and any folder or file creation gets trigger event and copies or creates same on to destination.

For example:
            /parentfolder
                /childfolder1/1.jpg
                /childfolder2/2.jpg
                     .
                     .
                     .

           /childglobalfolder/somefile.html 

and then I add a new folder in source location /childglobalfolder under parent folder with files, I do not find this triggering! Am I missing anything?

Please find below my code as in code view:

{ "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "actions": { "Create_file": { "inputs": { "body": "@triggerBody()", "host": { "api": { "runtimeUrl": "https://logic-apis-eastus.azure-apim.net/apim/ftp" }, "connection": { "name": "@parameters('$connections')['ftp_1']['connectionId']" } }, "method": "post", "path": "/datasets/default/files", "queries": { "folderPath": "/", "name": "@{triggerOutputs()['headers']?['x-ms-file-path']}" } }, "runAfter": {}, "type": "ApiConnection" } }, "contentVersion": "1.0.0.0", "outputs": {}, "parameters": { "$connections": { "defaultValue": {}, "type": "Object" } }, "triggers": { "When_a_file_is_created": { "inputs": { "host": { "api": { "runtimeUrl": "https://logic-apis-eastus.azure-apim.net/apim/box" }, "connection": { "name": "@parameters('$connections')['box']['connectionId']" } }, "method": "get", "path": "/datasets/default/triggers/onnewfile", "queries": { "folderId": "109772848XX" } }, "metadata": { "109772848XX": "/parentfolder" }, "recurrence": { "frequency": "Second", "interval": 15 }, "type": "ApiConnection" } }

}

Upvotes: 0

Views: 1141

Answers (1)

TusharJ
TusharJ

Reputation: 1263

No currently the connectors don't support folder events. I see most of them have the file events only. You should vote for adding this idea feedback.azure.com/forums/287593-logic-apps

Upvotes: 1

Related Questions