I'm scratching my head for some reason on how member username translates to the member's profile URL.
Two members for consideration:
ThisIsMe123
-->community.base.domain/members/thisisme123
This-Is-Me-456
-->community.base.domain/members/this_2d00_is_2d00_me_2d00_456
The first one seems simple enough: force lowercase on all of the characters. Got it.
The second one seems a little tougher to wrap my head around. I think I've worked out how this happens, but someone please chime in if there's a secret sauce (function with or without the database) I might be missing.
Starting String | Operation | Result |
This-Is-Me-456 |
Find any non-alphanumeric and non-period characters. Replace them with Decimal ASCII code for dash (-): 45 Hex of 45: 2D |
This_2D00_Is_2D00_Me_2D00_456 |
This_2D00_Is_2D00_Me_2D00_456 |
Lowercase all characters |
this_2d00_is_2d00_me_2d00_456 |
This seems simple enough except there are two follow-up questions:
- What characters are "non-compliant" and need to be converted via the ASCII HEX?
- Is there a better way to handle this? For the sake of this discussion, assuming whatever needs to be done needs to operate in traditional T-SQL.
Reasoning
My company is trying to automate some reporting "outside" of the platform with PowerBI, Tableau, or something else. The specifics of the reporting platform are outside my realm of responsibility. We're trying to find a way to pull back the username and make it "clickable" to take you to the member's page.
Additional syntax fix.
[edited by: KMSigma at 3:17 PM (GMT 0) on Tue, Mar 21 2023]