Reputation: 3
I am trying to read files from SFTP using logic app SFTP-SSH connector. SFTP has multiple files, but we want to read files with file names starting with "Client" eg Client_xyz.txt, Client_123.txt.
I have added the trigger condition but SFTP trigger is continuously failing with error :
Expression :
@contains(base64ToString(triggerOutputs()?['headers']?['x-ms-file-name-encoded']),'Client')
OR
@contains(base64ToString(triggerOutputs()?['headers']?['x-ms-file-name']),'Client')
Code InvalidTemplate
I can see this in the trigger output :
I check the expression using compose shape and expression is executing successfully and giving the desired result.
Please guide me if I am doing anything wrong here.
Thanks in advance.
Checked the expression in variable & compose shape and expression is giving the expected result.
Upvotes: 0
Views: 53
Reputation: 6497
I believe, you are using either Get file content or Get file content using path action to read the files but these actions expects either file id or path of the file as an input but you are passing contains(base64ToString(triggerOutputs()?['headers']?['x-ms-file-name']),'Client')
expressions doesn't evaluates to the inputs expected by these actions.
Alternatively, I am using given workflow to read the file names starts with Client.
Able to get the contents.
Use given design while using When a file is added or modified trigger.
Upvotes: 0