web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / 502 BadGateway - Inval...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 5

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

Categories:
I have the same question (0)
  • Verified answer
    RezaDorrani Profile Picture
    12,143 on at

    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

  • v-litu-msft Profile Picture
    on at

    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 Profile Picture
    5 on at
    Yes, it works now!

    Thank you
  • Community Power Platform Member Profile Picture
    on at

    Thanks Reza for you contribution to the Power Platform. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard