I am migrating from Salesforce, I tried to translate this Salesforce formula field to strip away everything around the domain for the website field into one I could use for Zoho:
Salesforce Version:
- IF(BEGINS(Website, "www."), MID(Website, FIND('www.', Website, 1)+4, (LEN(Website) - FIND('www.', Website, 1)+4)),
- if(find("/",
- if(find("www.",Website)>0,
- IF(FIND("//",Website)>0,substitute(Website,left(Website,find("//www.",Website)+5),NULL),Website),
- IF(FIND("//",Website)>0,substitute(Website,left(Website,find("//",Website)+1),NULL),Website)))>0,left(
- if(find("www.",Website)>0,
- IF(FIND("//",Website)>0,substitute(Website,left(Website,find("//www.",Website)+5),NULL),Website),
- IF(FIND("//",Website)>0,substitute(Website,left(Website,find("//",Website)+1),NULL),Website)),find("/",
- if(find("www.",Website)>0,
- IF(FIND("//",Website)>0,substitute(Website,left(Website,find("//www.",Website)+5),NULL),Website),
- IF(FIND("//",Website)>0,substitute(Website,left(Website,find("//",Website)+1),NULL),Website)))-1),
- if(find("www.",Website)>0,
- IF(FIND("//",Website)>0,substitute(Website,left(Website,find("//www.",Website)+5),NULL),Website),
- IF(FIND("//",Website)>0,substitute(Website,left(Website,find("//",Website)+1),NULL),Website))))
Attempt Zoho Version:
- If(Startswith(${Accounts.Website}, 'www.'), Substring(${Accounts.Website}, Find('www.', ${Accounts.Website}, 1)+4, (Len(${Accounts.Website}) - Find('www.', ${Accounts.Website}, 1)+4)),
- If(Find('/',
- If(Find('www.',${Accounts.Website})>0,
- If(Find('//',${Accounts.Website})>0,Replace(${Accounts.Website},Substring(${Accounts.Website},0,Find('//www.',${Accounts.Website})+5),''),${Accounts.Website}),
- If(Find('//',${Accounts.Website})>0,Replace(${Accounts.Website},Substring(${Accounts.Website},0,Find('//',${Accounts.Website})+1),''),${Accounts.Website})))>0,Substring(
- If(Find('www.',${Accounts.Website})>0,
- If(Find('//',${Accounts.Website})>0,Replace(${Accounts.Website},Substring(${Accounts.Website},0,Find('//www.',${Accounts.Website})+5),''),${Accounts.Website}),
- If(Find('//',${Accounts.Website})>0,Replace(${Accounts.Website},Substring(${Accounts.Website},0,Find('//',${Accounts.Website})+1),''),${Accounts.Website})),0,Find('/',
- If(Find('www.',${Accounts.Website})>0,
- If(Find('//',${Accounts.Website})>0,Replace(${Accounts.Website},Substring(${Accounts.Website},0,Find('//www.',${Accounts.Website})+5),''),${Accounts.Website}),
- If(Find('//',${Accounts.Website})>0,Replace(${Accounts.Website},Substring(${Accounts.Website},0,Find('//',${Accounts.Website})+1),''),${Accounts.Website})))-1),
- If(Find('www.',${Accounts.Website})>0,
- If(Find('//',${Accounts.Website})>0,Replace(${Accounts.Website},Substring(${Accounts.Website},0,Find('//www.',${Accounts.Website})+5),''),${Accounts.Website}),
- If(Find('//',${Accounts.Website})>0,Replace(${Accounts.Website},Substring(${Accounts.Website},0,Find('//',${Accounts.Website})+1),''),${Accounts.Website}))))
I keep getting
You don't have the right number of arguments. Check your functions ending with () to make sure you entered all the inputs they require.
Ok, fair, it's a complicated formula and I may have messed up.
But then I tried the most simple formula:
- If(Startswith(${Accounts.Website}, 'www.'),Substring(${Accounts.Website},4,Len(${Accounts.Website})))
And I got the same error!!!! WTF!!!!
I am beyond frustrated. All I want to do is get the domain from the website field and strip out any "https://" "www." and any "/" after the domain.
Thank you