cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nichtzuhelfen
Regular Visitor

Strange behaviour in string comparison

Hi,

I have a really strange problem with a string comparison.

 

In a SharePoint list I have two columns "Title" and "Link"  that looks like this:

TitleLink
ABC123https://mycompany.sharepoint.com/sites/MySharePointSite/SitePages/ABC123.aspx

 

In a simple power app I want to compare the title with the last part of the link. Because the link is encoded I have a quite complex Substitute formula to extract the last part:

 

 

Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(

    Substitute(Link;"https://mycompany.sharepoint.com/sites/MySharePointSite/SitePages/";"");".aspx";"")

    ;"%20";" ");"%2E";".");"%2C";",");"%5F";"_");"%2D";"-");"%28";"(");"%29";")");"%26";"&");"%40";"@");"%C3%A4";"ä");"%C3%84";"Ä");"%C3%B6";"ö");"%C3%96";"Ö");"%C3%BC";"ü");"%C3%9C";"Ü");"%C3%9F";"ß"))

 

 

 

This gives me "ABC123". BUT now comes the strange part. I have tried different things that I put in a label:

nichtzuhelfen_0-1646218671566.png

In the first row on the left is the "Title" and on the right the converted "Link".

The second row shows the Len() of each of them. It says that the converted link has 7 characters (?)

The third row prints the first 3 characters of the converted link. Note that the blank space character " " does NOT come from the link, because I added it by hand after the colon. Like this: "First 2 characters: " & Left(converted; 3). So there is just "AB" from the link where it should be "ABC". The first character is just invisible or comes from the stars or whatever...

 

The last 3 rows are showing comparisons. The statements are working properly regarding the invisible first character from the row above. So "ABC123" is in "?ABC123" but not the other way round. "ABC123" is not starting or ending with "?ABC123". And "?ABC123" is also not starting with "ABC123" but is ending with this string.

 

One possible solution could be to shorten the converted link to the real length of the title:

 

 

Right(converted; Len(Title))

 

 

But I think this could be dangerous if the strange invisible character decides to appear at the end of the converted string.

 

Trim() also doesn't bing the solution, because the invisible character is no " ". It is something else. ANY IDEAS what this character could be?!?

 

 

3 REPLIES 3
EddieE
Super User
Super User

@nichtzuhelfen 

What data type is your column ‘Link’? Is it Single line of Text or Hyperlink?

nichtzuhelfen
Regular Visitor

Ah I forgot to mention. Title is single line and Link is multiple lines of text.

@nichtzuhelfen 

Ok. I try to avoid using Multi line of text in my apps because they can cause some issues. If your links will fit inside a single line of text column I’d try using that and see if that corrects this behaviour?

 

It may also have something to do with the format of your Multi line of text column. I think formats like ‘rich text’ can cause power app issues

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,753)