Something like this?
var Num = Text($feature.Num)
var txt1
var txt2
if(Count(Num) == 10) {
// if 10 digit run this
txt1 = Left(Num, Count(Num)-6)
txt2 = Right(Num, Count(Num)-4)
} else {
// if 9 digit run this
txt1 = Left(Num, Count(Num)-5)
txt2 = Right(Num, Count(Num)-4)
}
return "https://rec-search.Yoyo/find/search.asp?dfYear="+ txt1 + "&dfDocumentStart=" + txt2
Seems like you're always using the 4 left digits and the 4 right digits. Why not just do this?
var Num = Text($feature.Num)
var txt1 = Left(Num, 4)
var txt2 = Right(Num, 4)
return url = "https://rec-search.Yoyo/find/search.asp?dfYear="+ txt1 + "&dfDocumentStart=" + txt2
Have a great day!
Johannes