Flow filter “contains” not working
-
11-01-2021 - |
質問
I want to create a Flow to my SharePoint list to send a message to MS Teams. I am using the template "Notice the Team when specific document uploaded" (don't know the exact English wording for it, I have a Swedish version). I want it to trigger (answer "yes") when the uploaded document contains the word "report" in its filename. But it is never working. Trying to enclose the report word in quotation marks """
, "'"
..and so on. But no.
In the Post messageScope step in Flow, I choose Filename, contains, and report. In advanced mode it looks like this:
@contains(triggerOutputs()['headers']['x-ms-file-name-encoded'], 'report')
Thankful for any guidance on this.
解決
it won't work with the Dynamic expression of "File name" for contains you need your value to be a string, implement this as below screenshot that should work
EDIT- I tried playing with Flow output and here is my find the Dynamic property File Name is actually the mapped to x-ms-file-name-encoded
which is the ID and not x-ms-file-name
which contains the actual filename
So your contains statement also works if you replace it as below
@contains(triggerOutputs()['headers']['x-ms-file-name'], 'report')