Help

Re: Combining mutliple rows of records into one entry

1991 0
cancel
Showing results for 
Search instead for 
Did you mean: 
J_Michael_Euge1
4 - Data Explorer
4 - Data Explorer

I use a service that exports a list of movies. Whenever there are multiple countries or directors it puts them into a new row below the main record. Is there any way to combine these additional rows of entries automatically so they all go into the same row as the movie title?

Here’s the airtable in question:

4 Replies 4

Are you importing a CSV or Excel file?

I’ve been importing a CSV file but imagine I could do in a different format. Why?

It may be easier to clean up the CSV file before importing so that multiple director or country are on the same row in the CSV, it looks like they are on separate rows in the CSV file.

Hi,

single time solution
add ‘t2’ column next to ‘title’ and use this script to fill it.


const table=base.getTable('Imported table');
const query=await table.selectRecordsAsync({fields:['title','t2']})
let movieName='initialValue'; 
const getName=rec=>(movieName=rec.getCellValue('title')?  rec.getCellValue('title') : movieName )
const update=(el)=>({'id':el.id,'fields':{'t2':getName(el)}})
const upd=query.records.map(update);
while (upd.length) await table.updateRecordsAsync(upd.splice(0,50))

then create third empty table ‘grouped’
in ‘Imported table’, near ‘t2’ create linked field (to ‘grouped’)
copy-paste t2 into it
image

turn to ‘grouped’ and get your data via lookups
then convert these lookups to your desired type and name
image