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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,978)