Ravi Ranjan
Ravi Ranjan

Reputation: 3

Logic App SFTP-SSH trigger condition failing

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 :

enter image description here

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

Answers (1)

Ikhtesam Afrin
Ikhtesam Afrin

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.

enter image description here

enter image description here

enter image description here

Able to get the contents.

enter image description here

Use given design while using When a file is added or modified trigger.

enter image description here

enter image description here

Upvotes: 0

Related Questions