Hey there!
I have an automation that is designed to take specific records from two separate tables and duplicate them into a single table. I used the repeat for each duplicate one of the tables, but because I can't use two I'm trying to do the same using a script but failing to add many of the record details.
let inputs = input.config();
let destinationTable = base.getTable("Executive Summaries copy");
let sourceTable = base.getTable("5-Year Automation");
let importQuery = await sourceTable.selectRecordsAsync();
let fivYearInputList = inputs.fiveYearInputList;
for (let record of importQuery.records) {
let strategicObjective = record.getCellValue('Strategic Objective')
let updates = record.getCellValue('Monthly Update')
let forcedOrder = record.getCellValue('Forced Order')
let divisions = record.getCellValueAsString('Executive Sponsor')
let whatIsBeingImplemented = record.getCellValue('What is being implemented?')
let currentHealth = record.getCellValue('Current Health')
let targetDeploymentDate = record.getCellValue('Target Deployment Date')
let risksAndIssues = record.getCellValue('Risks & Issues')
let whatAreTheBenefits = record.getCellValue('What are the benefits?')
let whyAreWeMakingThisChange = record.getCellValue('Why are we making this change?')
let focusArea = record.getCellValue("Focus Area")
let taskOwners = record.getCellValueAsString('Owner')
await destinationTable.createRecordAsync({
"Internal Initiative": strategicObjective,
"Strategic Objective": focusArea,
"Divisions": divisions,
"What is being implemented?": whatIsBeingImplemented,
"Current Health": currentHealth,
"Target deployment date": targetDeploymentDate,
"Updates": updates,
"Risks and Issues": risksAndIssues,
"What are the benefits?": whatAreTheBenefits,
"Why are we making this change?": whyAreWeMakingThisChange,
"Task Owners": taskOwners,
"Label - Benefits": "Benefits",
"Label - Purpose of Change": "Purpose of Change"
})
}
The reason for a single automation is that we want to initiate it using a form as needed.
Thanks for any help!