Announcement

Collapse
No announcement yet.

Add additional conditions to website field strip url.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add additional conditions to website field strip url.

    Hi,

    Website field takes in url and if strip is check in Entity Field properties. It removes https:// in front of website.
    i.e https://example.com turns to example.com

    is it possible to add additional conditions where it also strip if website is as such
    https://example.com/sitepage1 to example.com

    Since validation works before formula. And I have added Website in Duplicate Check
    https://example.com/sitepage1 and https://example.com/sitepage2
    both gets inserted as example.com . As formula works after Duplicate Check.


    Last edited by william34; 06-26-2023, 11:40 AM.

  • #2
    You probably have to play with RegEX and Formula to do this. Unfortunately I don't know any known example that do this yet.

    Comment


    • #3
      Hi william34,

      Please try to test this formula script for website field in any entity:
      Code:
      website = string\match(website, '/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/');

      Comment

      Working...
      X