Help

This Product Ideas board is currently undergoing updates, but please continue to submit your ideas.

Create a "split" string function for formulas

cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Zollie
10 - Mercury
10 - Mercury

Google sheets already supports this, whereas Excel does not. Airtable would be wise to follow Googleโ€™s lead. Or leapfrog them both and add a ton of array functionality.

7 Comments
Bill_French
17 - Neptune
17 - Neptune

We often make product suggestions that are based on obvious needs. Hereโ€™s one that falls into the not-so-obvious category and the lack of support for @Zollieโ€™s recommendation is evidence the community isnโ€™t aware of the power of a Split() function.

In my view, Split() changes everything about formulas involving text and arrays.

Recently, @Abraham_Bochner desperately reached out for help to parse a collection of strings (like this) to get the values.

<ANUZ2B2KI2XTG;ANUZ2B2KI2XTG;23.93+0=23.93;Me;26.12;Ig:r#5:>

The Airtable formula to extract 23.93 from this string this is insanely complex and almost impossible to create, let alone maintain.

RIGHT( LEFT(MID({Data Cell}, FIND(";", {Data Cell}) + 1, FIND("+", {Data Cell}) - 1), FIND("+", MID({Data Cell}, FIND(";", {Data Cell}) + 1, FIND("+", {Data Cell}) - 1)) - 1), LEN(LEFT(MID({Data Cell}, FIND(";", {Data Cell}) + 1, FIND("+", {Data Cell}) - 1), FIND("+", MID({Data Cell}, FIND(";", {Data Cell}) + 1, FIND("+", {Data Cell}) - 1)) - 1)) - FIND(";", LEFT(MID({Data Cell}, FIND(";", {Data Cell}) + 1, FIND("+", {Data Cell}) - 1), FIND("+", MID({Data Cell}, FIND(";", {Data Cell}) + 1, FIND("+", {Data Cell}) - 1)) - 1)) )

With the Split() method (or function) itโ€™s this simple:

{Data Cell}.split(";")[2].split("+")[0]

Why this suggestion is not upvoted by the vast community membership is a mystery to me because I see repeated instances of unimaginable and unsustainable formula workarounds to do what should be absolutely effortless.

The underlying code to support Split() is also simple, well-understood and tested, and easy to implement. Ergo, I also cannot understand why Airtable isnโ€™t all over this. Itโ€™s the one function that elevates the capabilities above all when users must transform or understand their data.

Adrian_Head
6 - Interface Innovator
6 - Interface Innovator

The Split() and array table functionality is still something I look for in a daily basis.

Itโ€™s one of the only reasons I still use Excel (for โ€œText to Columnsโ€) and Google sheets

Having this would be a huge help to those of us who are required to maintain many different kinds of data parsing formulas for different clients with slightly different needs. Itโ€™s very tedious :disappointed:

Airtable pleaseeeee address this โ€“ we will love you even more then we already do Heart

Tim_Mackey
6 - Interface Innovator
6 - Interface Innovator

Ooh boy, do I ever need this. Iโ€™m often dealing with JSON data, and I need to pull it apart to extract values. Writing formulas in Airtable to accomplish this is a nightmare! A split() function would make things 1000x easier.

Tim_Mackey
6 - Interface Innovator
6 - Interface Innovator

Like seriously, here is the code I needed to write to extract a single value from a JSON string. Just ONE value!! Thereโ€™s no way this is efficient on Airtableโ€™s servers.

IF(
  ISERROR(
    LEFT(
      RIGHT(
        {Customer Fields},
        LEN({Customer Fields})
            - LEN('"company":"')
          - SEARCH('"company":"',{Customer Fields})
          + 1
      ),
      SEARCH(
        '"',
        RIGHT(
          {Customer Fields},
          LEN({Customer Fields})
              - LEN('"company":"')
            - SEARCH('"company":"',{Customer Fields})
        )
      )
    )
  ),
  "",
  LEFT(
    RIGHT(
      {Customer Fields},
      LEN({Customer Fields})
          - LEN('"company":"')
        - SEARCH('"company":"',{Customer Fields})
        + 1
    ),
    SEARCH(
      '"',
      RIGHT(
        {Customer Fields},
        LEN({Customer Fields})
            - LEN('"company":"')
          - SEARCH('"company":"',{Customer Fields})
      )
    )
  )
)

LEFT(
  RIGHT(
    {Customer Fields},
    LEN({Customer Fields})
        - LEN('"company":"')
      - SEARCH('"company":"',{Customer Fields})
      + 1
  ),
  SEARCH(
    '"',
    RIGHT(
      {Customer Fields},
      LEN({Customer Fields})
          - LEN('"company":"')
        - SEARCH('"company":"',{Customer Fields})
    )
  )
)
Bill_French
17 - Neptune
17 - Neptune

Iโ€™m torn between tapping the โ€œlikeโ€ for your post and writing a deep indictment reflecting years of warnings concerning string parsing.

Your formula underscores many such examples that I have posted here over the years and despite this, the insanity continues and other features which have minimal impact continue to get attention. I have called out to the new product manager a number of these cases which have occurred in the triple-digits since 2016. We see approximately one frustrating message like this a day on average. I suspect there are many frustrations that go unstated.

This pattern demonstrates rudderless product management - where else should users place the blame?

Thoughts @Taylor_Savage?

Workaround Remedy

Build a script block that retrieves the JSON data and use javascriptโ€™s JSON.parser() method to tease out the data you need. This is the only reasonable approach and sadly requires code in this largely codeless environment.

Tim_Mackey
6 - Interface Innovator
6 - Interface Innovator

Agreed about everything youโ€™ve said. Airtable is a powerful product, which is why I keep coming back to it, but limitations like this are a constant frustration to me.

I had no idea script blocks were a thing. Iโ€™m an experienced Javascript programmer, so this could potentially make things easier for me. Iโ€™ll have to look into this, thanks for the tip! Do script blocks need to be manually triggered or can they be scheduled/automated/auto-triggered?

Bill_French
17 - Neptune
17 - Neptune

Script Blocks are manually triggered, whereas Script Actions can be automated and based on events to a degree.