How do I make LookupAndCopy work

How do I get the lookupAndCopy function to work? I have been using the example given but it does not seem to work.

base.lookupAndCopy('Table2', 'Email1', 'Name1', 'Table1', 'Email', 'Name');

Hi, I’m sorry your question hasn’t got any answers yet. Perhaps posting your whole code or some screenshots could help?

I don’t really have full code. I have been playing around with the different examples to see how they work. I followed how it said in the Script documentation.

This is what I have been using to try the different examples.

var date = new Date();
let today = base.utils.formatDate(date);
output.text(today);

const copyTableName = 'Companies';
const copyViewName = 'Default View';
const copyColumnName = 'Name';
const copyColumnEmail = 'Email';
const pasteTable = 'Jobs';
const pasteColumnName = 'Name';
const pasteColumnEmail = 'Email';

const outputTable = base.getTableByName(pasteTable);
const outputView = base.getViewByName(outputTable, 'Default View');
const outputRows = base.getRows(outputTable, outputView);
const table = base.getTableByName(copyTableName);
const view = base.getViewByName(table, copyViewName);
const rows = base.getRows(table, view);

base.lookupAndCopy(pasteTable, pasteColumnEmail, pasteColumnName, copyTableName, copyColumnEmail, copyColumnName);

output.text(today);
output.text("end");

Please use

base.utils.lookupAndCopy('Table2', 'Email1', 'Name1', 'Table1', 'Email', 'Name');

Add utils.

We have just corrected the document.

Thanks @daniel.pan for the help.