cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Handling uriComponent() with > 65519 characters count

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

1 ACCEPTED SOLUTION

Accepted Solutions
Helper I
Helper I

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

View solution in original post

1 REPLY 1
Helper I
Helper I

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

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (5,426)