Hi, All. I am trying to get the dreadful Get Files to work.
My flow will be triggering on "When a file is modified" a library potentially having 1000s of files, with 10-100 files modified at once.
I am copying files, and then need to get their IDs, because the "wonderful" Copy File doesn't care about metadata.
I'm fine to do it myself, but the "wonderful" Copy File does not return the ID of the new file, which is required by the Update File (requires numeric ID).
So I'm using Get Files in order to get the ID.
But since the library is BIG, I don't want to dump all the files into flow, and then loop through 1000s of files, looking for the right name and path.
Instead, I want to build a filter!
The boards are littered with messages like "Name/Path/FileRef/etc do not work!"
So I looked into the output of Get Files w/o a filter. Here's a (redacted) sample for one file out of many
>>>
{
"@odata.etag": "\"1\"",
"ItemInternalId": "55",
"ID": 55,
"Modified": "2017-11-17T00:09:13Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Department": null,
"JobTitle": null
},
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Department": null,
"JobTitle": null
},
"Created": "2017-11-17T00:09:13Z",
"OData__dlc_DocId": "HIWSAS2VENCA-908746327-55",
"OData__dlc_DocIdUrl": "https://###.sharepoint.com/sites/###/_layouts/15/DocIdRedir.aspx?ID=HIWSAS2VENCA-908746327-55",
"{Identifier}": "StagingExternal%252fHER%252fTest%2b02%252fTransparent%2bKeyboard%2b01.png",
"{Link}": "https://###.sharepoint.com/sites/###/StagingExternal/HER/Test%2002/Transparent%20Keyboard%2001.png",
"{Name}": "Transparent Keyboard 01",
"{Path}": "StagingExternal/HER/Test 02/",
"{ContentType}": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
"Id": "0x0101001AE9008232653842A7D277CC16324094",
"Name": "Document"
},
"{ContentType}#Id": "0x0101001AE9008232653842A7D277CC16324094"
}>>>
As we can see, the Name, the Path and even the Link are present, albeit in a funky format with curly brackets: {Name}
So I'm building a filter
>>>
{Name} eq 'variables['TargetName']'>>>
While trying to query for it in the $filter, I get a 400 (Bad Request) error:
>>>
The $filter expression \"{Name} eq 'TC8000_TransparentKB_Public.zip'\" is not valid >>>
I tried all combinations of URLescaping, single and double quotes, escaping quotes etc, but could not get it to work.
Was anyone able to get it to function? How would one address fields such as {Name} in oData filters?
Thanks!