Summary: I have created a flow to rename PDF files I have saved to a sharepoint site. The flow creates an array from an excel file I have saved on OneDrive which contains the original file name and the name I would like to update each file to. It is supposed to iterate through each file listed in the excel file but I keep getting bad request 400 errors at the HTTP stage.
I really tried to research and solve this problem on my own (see bottom of post for list of a few resources I checked) but at this point I feel totally lost and everything is a blur. I am still very new to Power Automate... Any suggestions as to what I have done wrong? I confirmed I have user permission to the sharepoint site. Sorry if the following is information overkill but I figured more is preferrable in this situation.
My flow:

HTTP Settings:

What I have tried:
- Tried multiple site address options:
- Tried multiple Uri options **Note that Source_File is a field pulled from the "List rows present" output**
- _api/web/lists/GetByTitle('Test_Logging')/items('Source_File') **without commas*
- _api/web/lists/GetByTitle('Test_Logging')/items(Source_File) **with commas**
- I read that the GetByTitle() field needs to list the sub-folder...
- Ensured the following in the Parameters/Body:
- __metadata (two underscores vs one)
- Tried a test where I removed all the spaces in the original file name
Http Input Looks as Follows:
{
"host": {
"connectionReferenceName": "shared_sharepointonline",
"operationId": "HttpRequest"
},
"parameters": {
"parameters/method": "POST",
"parameters/uri": "_api/web/lists/GetByTitle('XYZ')/items('test.pdf')",
"parameters/headers": {
"content-type": "application/json;odata=verbose",
"IF-MATCH": "*",
"X-HTTP-Method": "MERGE"
},
"parameters/body": "{'__metadata': {'type': 'SP.Data.BItem'}, 'FileLeafRef': 'newtestname.pdf - {\"@odata.etag\":\"\",\"ItemInternalId\":\"ebe10853-7888-4d1f-af73-3ba7f9784de9\",\"Source_File\":\"test.pdf\",\"Name_To\":\"newtest.pdf\"}'}"
}
}
HTTP Output:
Troubleshooting Sources I have read: