Auto fill a column with data from the same row

Hi there,
I’m very new to js,
Is there a way to fill a column with data from a row with a script linked to a button?



Without getting into the nitty gritty of matching field type to field type, the most basic javascript to copy one field value from the record on which a button was clicked into another field in all records:

let config = input.config({
    title: 'Copy one value from one record into all records',
    description: 'Test script developed by Kamille Parks, provided without warranty, to answer the following question from the Community Forums:',
    items: [
        input.config.table('table', {
            label: 'Table'
        input.config.field('originField', {
            label: 'Origin Field',
            description: 'Field from which a value will be copied',
            parentTable: 'table'
        input.config.field('destinationField', {
            label: 'Destination Field',
            description: 'Field into which the value will be pasted',
            parentTable: 'table'

let {table, originField, destinationField} = config

let query = await table.selectRecordsAsync({fields: [destinationField, originField]})
let records = query.records

let record = await input.recordAsync('Selected Record', table)

if (record) {
    let originValue = record.getCellValueAsString(originField)
    let updates = => {
        return {
            fields: {
                []: originValue
    while (updates.length > 0) {
        await table.updateRecordsAsync(updates.slice(0, 50))
        updates = updates.slice(50)
} else {
    output.text("No record selected")