cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simpim
Level: Powered On

502 BadGateway - Invalid URI when creating folder on SharePoint using subject line of incoming email

I have created a simple automated flow for certain incoming emails that creates a folder on SharePoint and uploads the body of the email and any attachments to said folder. The folder is named using the subject line of the incoming email.

 

Sometimes this flow fails at the create folder stage due to the following error message, "Invalid URI: The format of the URI could not be determined."

 

My initial thought was that this may be due to invalid characters in the subject line of the email. Is there a way to replace invalid characters with another character or any other workaround?

 

Manny

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: 502 BadGateway - Invalid URI when creating folder on SharePoint using subject line of incoming email

Hi @simpim 

 

use this expression to remove all special characters

 

replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(variables('artifactName'),':',''),'%',''),'#',''),'*',''),'<',''),'>',''),'?',''),'/',''),'"',''),'"',''),'@',''),'&',''),'=',''),'/',''),';',''),'|',''),'\',''),'[',''),']',''),'~',''),'{',''),'}',''),'^',''),'!',''),',',''),'.',''),' ','')
 
variables('artifactName') - can be updated with you email subject
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

3 REPLIES 3
Super User
Super User

Re: 502 BadGateway - Invalid URI when creating folder on SharePoint using subject line of incoming email

Hi @simpim 

 

use this expression to remove all special characters

 

replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(variables('artifactName'),':',''),'%',''),'#',''),'*',''),'<',''),'>',''),'?',''),'/',''),'"',''),'"',''),'@',''),'&',''),'=',''),'/',''),';',''),'|',''),'\',''),'[',''),']',''),'~',''),'{',''),'}',''),'^',''),'!',''),',',''),'.',''),' ','')
 
variables('artifactName') - can be updated with you email subject
 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Community Support Team
Community Support Team

Re: 502 BadGateway - Invalid URI when creating folder on SharePoint using subject line of incoming email

Hi @simpim,

 

Have you solved your problem according to @RezaDorrani's suggestion?

 

If yes, you can mark Accept his reply as the solution to help the other members find it more quickly.

If no, could you share your folder name instance? If so we can assist you better.

simpim
Level: Powered On

Re: 502 BadGateway - Invalid URI when creating folder on SharePoint using subject line of incoming email

Yes, it works now!

Thank you

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 112 members 4,361 guests
Recent signins:
Please welcome our newest community members: