how to parse list from database

Support
  • I am taking my database to my list in browser automation Studio but I'm facing a problem that it also has the row ID which I don't want I want to parse it so that is removed how we can do with the normal string

    anyone any clue why this javascript is giving syntax error if? and also there is a proper documentary for the JavaScript that works with browser automation Studio please link it to me as well

    function removeLastColumnsFromList(inputList, columnsToRemove) {
      const outputList = inputList.map(inputString => {
        const parts = inputString.split(':');
        if (parts.length < columnsToRemove) {
          return inputString; // Return the original string if there are fewer columns than requested to remove.
        }
        
        return parts.slice(0, parts.length - columnsToRemove).join(':');
      });
    
      return outputList;
    }
    
    // Example usage:
    const inputList = [
      "randomstring:randomstring:randomstring:randomstring:randomstring:randomstring:randomstring:randomstring",
      "example1:example2:example3:example4:example5:example6",
      "abc:def:ghi:jkl",
    ];
    const columnsToRemove = 2;
    
    const outputList = removeLastColumnsFromList(inputList, columnsToRemove);
    var [[colist]] = outputList;
    
    

  • How to Use Database Accounts

    Support
    0 Votes
    20 Posts
    1384 Views
  • 0 Votes
    3 Posts
    658 Views
  • Parse new line to list?

    Support
    0 Votes
    4 Posts
    753 Views
  • 0 Votes
    3 Posts
    638 Views
  • 1 Votes
    2 Posts
    1039 Views