質問

I have two document libraries, one for working documents (word, excel, etc...) and one for published documents (pdf's). I have created a Flow to convert the document to pdf. Generally, it works. However, in order to update an existing (i.e. checked in) pdf, it must be checked out before the new file is created (no different than attempting so manually). So, when I run the Flow with a selected document in the working library, I need it to check out the corresponding (same named) document in the published library.

Here's the general flow:

Flow

I have tried two approaches to filtering the Get files step using the Filter Query.

Query 1: Name eq SOG_5000_001.docx
Output: { "status": 400, "message": "Column 'Name' does not exist. It may have been deleted by another user.}

Query 2: FileLeafRef eq SOG_5000_001.docx
Output: { "status": 400, "message": "Column 'SOG_5000_001.docx' does not exist. It may have been deleted by another user.}

EDIT: to clarify, the value 'SOG_5000_001.docx' is not hard-coded. Rather, it is the result of dynamic content from the Get file properties step.

I have confirmed that both documents have the same name (FileLeafRef) in their respective libraries. However, I cannot figure out why it errors rather than filtering for the single desired value.

FINAL: One other issue that I didn't realize initially was that I needed to compare 'SOG_5000_001.docx' to 'SOG_5000_001.pdf' because I wanted to use the word document name to determine the pdf document to check out. So, my final Filter Query is startswith(FileLeafRef,'Name') and I don't have to worry about file types at all.

役に立ちましたか?

解決

You need to wrap the value in single quotes 'SOG_5001_001.docx' when using an odata filter, whether in a Flow or otherwise. Without the quotes, it thinks you are trying to compare two different columns together, rather than a column to a constant string value.

So, your filter would look like FileLeafRef eq 'SOG_5001_001.docx'

These single quotes would still need to be in your flow step even if the parameter value is being dynamically passed from a Flow variable or value returned from previous step. See the screenshot below where I used a value from the triggerBody() as my dynamic input, though it could be any other valid Flow expression, but I hand-typed the single quotes around the dynamic value:

enter image description here

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top