I would like to trigger my logic app which is reading files from SFTP only if files with a certain name or extension are uploaded/modified. I want to avoid using multiple actions to check file name. Is there any possible way to edit File System/SFTP trigger conditions to check file name and accordingly trigger the logic app?
1 Answers
Yes you could. If you want to use trigger condition to check the file name, you have to use When a file is added or modified (properties only).
I test the one without properties only, I check the output is there any property to get the file name, and then I use @equals('47.txt',trigger()['outputs']['headers']['x-ms-file-name'])
as trigger condition, however I get this error message.
So this trigger could not meet your requirement. Then I test with properties only, this output body has a property Displayname
to get the file name. So I changed the codition to @equals('47.txt',trigger()['outputs']['body']['DisplayName'])
, with this codition, if the filename doesn't equal, it will be triggered, however it won't fired it.
Hope this could help you.