Left(myTextBox.Text, Find("/Forms", myTextBox.Text)-1)
With(
{splitUrl: Split(Left(myTextBox.Text, Find("/Forms", myTextBox.Text)-1), "/")},
Concat(FirstN(splitUrl, CountRows(splitUrl)-1), Value, "/")
)
Set(SiteList, Office365Groups.HttpRequest("https://graph.microsoft.com/v1.0/sites?$select=webUrl&search=*","GET","").value);
Set(Sites, SortByColumns(ForAll(SiteList,{WebUrl: Text(ThisRecord.webUrl),Length: Len(ThisRecord.webUrl)}),"Length",SortOrder.Descending));
Set(MapSite, LookUp(Sites, !IsBlank(Find(WebUrl,myTextBox.Text))))
Left(
myTextBox.Text,
Find(
"|",
Substitute(myTextBox.Text, "/", "|", Len(myTextBox.Text) - Len(Substitute(myTextBox.Text, "/", "")))
)
)
If(
//Checking if its a Doc Lib link
!IsBlank(
Find(
"Forms",
TextInputCanvas1.Value
)
),
//First removing everyting after /Forms in the link
Left(
Left(
TextInputCanvas1.Value,
Find(
"/Forms",
TextInputCanvas1.Value
) - 1
),
//findind the last / char before the document library name and using it to get the all the text before it
With(
{
_link: Left(
TextInputCanvas1.Value,
Find(
"/Forms",
TextInputCanvas1.Value
) - 1
),
_lookingFor: "/"
},
If(
EndsWith(
_link,
_lookingFor
),
Len(_link),
Find(
_lookingFor & Last(
Split(
_link,
_lookingFor
)
).Value,
_link
)
)
)
),
//Plain Link if its a direct link to a site or subsite
TextInputCanvas1.Value
)
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional