Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Handling uriComponent() with > 65519 characters count

(0) ShareShare
ReportReport
Posted on by 182

Hello lovely Community,

 

for an HTTP action I need to convert a String with > 65519 characters with uriComponent(). I've already recognized uriComponent() is limited to 65519:

 

Successfull with 65519 charactersSuccessfull with 65519 characters

 

Failed with 65520 charactersFailed with 65520 characters

 

Unfriendly Error Message:

"The template language function 'uricomponent' was invoked with invalid parameters. The parameter at index '0' cannot be converted to URI component."

 

So how I could handle my String to be able to encode it for URL with Power Automate? Unfortunately there's no special delimeter in string, its just a huge Token with random characters.

 

Already had thoughts about spliting the string to an array with items of 65519 characters. After I could set a Loop to convert it and then join every item back to my wanted uri string.

 

Many thanks for your help!

 

BR,

Sven

  • Verified answer
    KSven Profile Picture
    182 on at
    Re: Handling uriComponent() with > 65519 characters count

    Just have created Workaround solution. Works great, but maybe someone know a more friendly way like uriComponent()..

     

    replace(
        replace(
            replace(
                replace(
                    replace(
                        replace(
                            replace(
                                replace(
                                    replace(
                                        replace(
                                            replace(
                                                replace(
                                                    replace(
                                                        replace(
                                                            replace(
                                                                replace(
                                                                    replace(
                                                                        replace(
                                                                            replace(
                                                                                'YOUR TEXT',
                                                                                '%'
                                                                                '%25'
                                                                            ),
                                                                            '*'
                                                                            '%2A'
                                                                        ),
                                                                        ''''
                                                                        '%27'
                                                                    ),
                                                                    '('
                                                                    '%28'
                                                                ),
                                                                ')'
                                                                '%29'
                                                            ),
                                                            ';'
                                                            '%3B'
                                                        ),
                                                        ':'
                                                        '%3A'
                                                    ),
                                                    '@'
                                                    '%40'
                                                ),
                                                '&',
                                                '%26'
                                            ),
                                            '=',
                                            '%3D'
                                        ),
                                        '+',
                                        '%2B'
                                    ),
                                    '$',
                                    '%24'
                                ),
                                ',',
                                '%2C'
                            ),
                            '/',
                            '%2F'
                        ),
                        '?'
                        '%3F'
                    ),
                    '!',
                    '%21'
                ),
                '#',
                '%23'
            ),
            '[',
            '%5B'
        ),
        ']',
        '%5D'
    )
     
    BR,
    Sven

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,695 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow