Reputation: 406
I'm creating am Azure Logic App to add new Sharepoint files to an Azure Blob. The Sharepoint is run by my company and I log in with my credentials to create the Sharepoint API for the Logic App. It allows me to access the various sharepoint sites in the trigger set-up, but the next field displays "Bad Gateway" where it usually shows the folders. I've build several simple logic apps and never had this problem. I'm unsure where to even find an error message or anything that would help here.
Has anyone else had this issue? Can't find much online about it, especially since there is no error code.
Also, No "App" or "Error" in questions?
Upvotes: 2
Views: 2022
Reputation: 1076
I was struggling with this issue two days ago. Solved it by navigating to the folder in Sharepoint and creating a new Power Automate project. I then downloaded it, copyed the reference, deleted the Project, and pasted it back in Logic App.
Weirdly enough, even though it works, the Bad Gateway error still shows on the folder icon.
Upvotes: 1
Reputation: 11
I got the same BadGateway
The above proposed solution works but only if you are performing a Sharepoint action of 'Get file content'. There is no option in the trigger action which you used.("When a file is created in a folder").
It is pretty ugly so has anyone else managed to get rid of the BadGateway issue?
So in the "get file content" action there is the option to choose the site and that works. The next item is the File identifier box. All I did was type in the text myfilepathandname and then I saved the logic app.
Then I went into codeview and replaced myfilepathandname with /documents/folder a/folder b/folder c/filename.csv.
it looks horrible but if you put that in the file identifier box, it works
I don't have enough points to paste the image in but you can look at it via the link.
My File Identifier looks like this when you put the slashes and spaces back /Documents/1230000 Tech & Bus Services/1231814 Bus Systems/Integration/PowerBiTargets/2019_reforecast.csv
So try pasting in the same (with %252f and %2b) into your Folder Id box.
I will try it myself but if I were looking for files added to my PowerBiTargets folder I would use this in the Folder Id box. Just key it in or build it in notepad and then paste it.
%252fDocuments%252f1230000%2bTech%2b&%2bBus Services%252f1231814%2bBus Systems%252fIntegration%252fPowerBiTargets
Update:
I tried my suggestion in a trigger for "When a file is created or modified in a folder" and it works
Step 1 Create a "When a file is created or modified in a folder" Sharepoint trigger
When a file is created or modified in a folder
Step 2 Do something with the files detected as added or modified (I write to Azure blob storage)
Upvotes: 1
Reputation: 11
I'm getting the exactly the same issue with my Logic Apps all of a sudden. Like yourself i have vast experience with Logic Apps so i know it's nothing i'm doing wrong.
A work around for this is the following:
At the end of the line you should see:
files/@{encodeURIComponent('%252fShared%2bDocuments%252fSupport%2bUpdate%2bScript%252fUserEnabled%2bList%2bNew.csv')}/content
Upvotes: 0