Select to view content in your preferred language

Help removing part of text from a string for popup

551
4
Jump to solution
03-04-2024 08:05 AM
Laura
by MVP Regular Contributor
MVP Regular Contributor

Here is an example of the links in my attribute table

Laura_0-1709568276517.png

 

Some start with R some with mceas01. Either way I want to keep whatever comes after "R:/" or "\\mcenas01\" using arcade in a popup. I tried calling support but claimed they could not help. 

0 Kudos
1 Solution

Accepted Solutions
Laura
by MVP Regular Contributor
MVP Regular Contributor

Update:

This ended up working for me

Mid ($feature.Hyperlink, 24)

Create an expression and then set up the hyperlink to be the website + this expression

View solution in original post

4 Replies
VanessaSimps
Frequent Contributor

You could do an if else statement- and then use the Right Function with a 3 for the R:/ and a 11 for the \\mcenas01\ ? 

Laura
by MVP Regular Contributor
MVP Regular Contributor

The right function says it gets values at the end of the link. This changes so it won't work for me

0 Kudos
KenBuja
MVP Esteemed Contributor

You can use the Replace function to get rid of those strings, but you have to be careful. The Arcade interprets a backslash as part of an escape character, so you have to use it twice in Replace for it to work properly. This will replace either in a single line.

var output = Replace(Replace($feature.Hyperlink,'\\\\mcenas01\\',''),'R:\\','');

 

Laura
by MVP Regular Contributor
MVP Regular Contributor

Update:

This ended up working for me

Mid ($feature.Hyperlink, 24)

Create an expression and then set up the hyperlink to be the website + this expression