Dec 29 2021 07:11 AM
My objective is simple here- I'm copying and renaming a file in Flow, and I need to see if a file with the same name already exists.
Search query
https://graph.microsoft.com/v1.0/sites/xxxxx/drive/root/search(q='KPR Monthly User Report 2021-11-26.xlsx')
This does indeed return the file I'm searching for. However, it's also returning another file that in no way is related.
{
"@odata.type": "#microsoft.graph.driveItem",
"createdDateTime": "2021-11-26T14:08:23Z",
"id": "01UCCLNHJ3ZLOBX7R5FNGI7NZGUR3",
"lastModifiedDateTime": "2021-11-26T14:09:20Z",
"name": "KPR Monthly User Report 2021-11-26.xlsx",
"webUrl": "https://xxx/_layouts/15/Doc.aspx?sourcedoc=%xxx%7D&file=KPR%20Monthly%20User%20Report%202021-11-26.xlsx&action=default&mobileredirect=true&DefaultItemOpen=1",
"size": 19808,
},
{
"@odata.type": "#microsoft.graph.driveItem",
"createdDateTime": "2021-04-26T16:01:05Z",
"id": "01UCCLNHJGKNOO22ATQJAIDUOF6UY",
"lastModifiedDateTime": "2021-04-26T16:01:13Z",
"name": "ITG Final Export 4-26-2021.zip",
"webUrl": "https://xxx/Shared%20Documents/Internal-Tech/ITGlue-Exports/ITG%20Final%20Export%204-26-2021.zip",
"size": 73450349,
}
The second file is a zip. Even if it were to search contents, there is no file in the archive close to the searched filename.
Also not sure why the webUrl is in such a different format.
Any clue what's going on here? I can't seem to get any result by searching via other methods. I know there's other ways to handle a file conflict, but this has me confused and I'd just like to figure it out.
Getting the same result if I call via flow or testing in graph explorer.
Thanks