Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Pasting into a form versus pasting into data field view. Specifically issue with Tab character

Solved
Jump to Solution
1506 2
cancel
Showing results for 
Search instead for 
Did you mean: 
WaitroseCarpark
6 - Interface Innovator
6 - Interface Innovator

Hello all

I am trying to copy/paste a line from an HTML table into airtable. The table has several columns which are delimited by tabs (unicode 0009).

Nothing unusual so far...

I created a form so I could paste in the line into that maps onto a single field. When you do this it retains the tabs in the string...BUT...I am struggling to find a way of sanitising this data and splitting out the columns.

Yes, you can paste directly into the table field and split it out that way. I don't want this, I want to be able to paste the string/line directly into a form.

  • Using "\t" in formulas doesn't work.
  • With Windows 11 and pasting from Chrome, CTRL+SHIFT+V does not strip out any tabs (it's for formatting only)

So how else can I strip out these pesky tabs?

1 Solution

Accepted Solutions
ScottWorld
18 - Pluto
18 - Pluto

You could only handle that in Airtable by writing custom JavaScript code.

Question: If you paste the line into a Google Sheets cell, does Google Sheets recognize what you are trying to do? Does Google Sheets automatically split up the data into multiple columns for you?

If so, I would just paste into a new row of a Google Sheets spreadsheet that Make is monitoring using its Google Sheets automations, and then have Make automatically move the information into Airtable using its Airtable integrations.

See Solution in Thread

2 Replies 2
ScottWorld
18 - Pluto
18 - Pluto

You could only handle that in Airtable by writing custom JavaScript code.

Question: If you paste the line into a Google Sheets cell, does Google Sheets recognize what you are trying to do? Does Google Sheets automatically split up the data into multiple columns for you?

If so, I would just paste into a new row of a Google Sheets spreadsheet that Make is monitoring using its Google Sheets automations, and then have Make automatically move the information into Airtable using its Airtable integrations.

WaitroseCarpark
6 - Interface Innovator
6 - Interface Innovator

Excellent thank you @ScottWorld 

I've never used scripts before but using an automation to fire it as soon as the form was submitted was easy. I got ChatGPT to write me the script. Here if anyone is interested:

let table = base.getTable('Your Table Name'); // Replace 'Your Table Name' with your actual table name
let query = await table.selectRecordsAsync();

for (let record of query.records) {
    let originalString = record.getCellValue('String Input Field');
    
    // Check if the 'String Input Field' field is not null before replacing tab characters
    if (originalString !== null) {
        let updatedString = originalString.replace(/\t/g, ' '); // Replace tabs with spaces
    
        // Update the 'String Input Field (Sanitised)' field with the sanitized string
        await table.updateRecordAsync(record, {
            'String Input Field (Sanitised)': updatedString
        });
    }
}