cancel
Showing results for 
Search instead for 
Did you mean: 

Decode URL in PowerApps

Hallo PowerApps Team,

I need a function to decode a string in PowerApps.

 

In my business case I want to save text from only text multiline SharePoint field in an other sharepoint field with rich text turned on.

The problem is that all linebreaks get lost.

So I want to replace all line breaks with html line breaks.

 

In flow I found a solution.

uriComponentToString(replace(uriComponent(outputs('Mail_part')), '%0A', '</br>'))

 

But I want it in PowerApps.

I tried to use the functions "encodeUrl" and "plainText" but it does not work. PlainText function makes no decoding (it removes html and xml)! 

PlainText(Substitute(EncodeUrl(DataCardValue1.Text); "%0A"; "&lt;br/&gt;"))

The result is some ugly text with a lot of encoded signs like spaces "%20"

 

Ans ideas?

 

 

Status: New
Comments
Anonymous
Not applicable

Why is it taking so long to fix this simple bug? Since custom connector requires P1 plan one would expect to make this a priority. 😞 please i need this.

Anonymous
Not applicable

This can represent a lot of formulation to 'clean' any URL, and it's kinda annoying to nest so many substitute() functions in order to replace spaces and special characters in our input parameters. I like this idea.

ZachS15
Advocate I

I know this is an old thread, but this still isn't solved yet and I just ran into this problem as well. My problem was I had a multi-line address field that I wanted to display in a gallery on a single line. My solution was to use the Substitute() function with Char(10).

Substitute(ThisItem.Address, Char(10), " ") 

 

That replaced all line breaks with a Space. You could repurpose that to insert any text needed for your solution.

Nusserdt
Advocate I

2 years later, same issue here. It can only solved by hunderts of Substitutes.

 

Here a basic url conversion (german char set, inclomplete!)

Substitute(
    Substitute(
        Substitute(
            Substitute(
                Substitute(
                    Substitute(
                        Substitute(
                            Substitute(
                                Substitute(
                                    Substitute(
                                        Substitute(
                                            Substitute(
                                                Substitute(
                                                    Last(
                                                        Split(
                                                            OpenFolder.Text;
                                                            "%2F"
                                                        )
                                                    ).Result;
                                                    "%20";
                                                    " "
                                                );
                                                "%2E";
                                                "."
                                            );
                                            "%2C";
                                            ","
                                        );
                                        "%5F";
                                        "_"
                                    );
                                    "%2D";
                                    "-"
                                );
                                "%28";
                                "("
                            );
                            "%29";
                            ")"
                        );
                        "%26";
                        "&"
                    );
                    "%40";
                    "@"
                );
                "%C3%A4";
                "ä"
            );
            "%C3%B6";
            "ö"
        );
        "%C3%BC";
        "ü"
    );
    "%C3%9F";
    "ß"
)

Maybe microsoft can now see better how stupid this is.

Dan_Medeiros
Frequent Visitor

Totally