0
votes

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" } }

}

1
We can't guess your code, it seems you need some error handling or testing if the folder is there. - Peter
Triggers by definition is a mechanism to react on some events. Trigger is supposed to start the execution of the underlying workflow. Hence the connectors have trigger on the files being created or modified. If you share your definition it will help in understanding your ask. - TusharJ
@Peter, TusharJ Ok, so it means folder is also under watch and could kick off a trigger based action. I have pasted updates queried hoping it would get some help on knowing feasibility. Thanks - H Bala
I tried all possible ways to get a watch on parent folder and then tried creating a child folder with files in it. I find the app skipping on "Run trigger" :( - H Bala
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 - TusharJ

1 Answers

1
votes

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