Hi there! I'm getting some templated tasks set up for my team using the "create records using multiple templates" extension. Very useful! I've gone into the code and begun adding some additional fields to auto-populate. The simple ones were easy, but I have something trickier I'd like to pull off, and I'm unsure if it's possible.
These tasks can be dependent on another task. I'd love to be able to auto-populate that dependent task into that column as a linked record. But code wise, I'm imagining that it would somehow need to reference the other created records, pull the record ID, and populate that into the "Dependent Task" column. Any idea if this might be possible? This puts me a bit out of my depth as a low-coder 😅 Thanks for your consideration!
Here's the current part of the code, for reference:
// Filter the template records to match the selected type & add the parent ID to the map
let types = typesRecords.map(c => ({
'child': [c],
'childName': c.getCellValue(childFieldInTemplate),
'templateTypes': c.getCellValue(templateType).map(x => x.id),
'templateOrder': c.getCellValue(templateOrder),
'templateStatus': {name: c.getCellValueAsString('Status')},
'templateDueDays': c.getCellValue('numDaysBeforeDue'),
'templateNotes': c.getCellValue('Notes')
// Add additional template fields here and in section below using format below.
// Field names within c.getCellValue parentheticals should match field names in template table
// 'templatePhase':c.getCellValue('Phase'),
// 'templateDays': c.getCellValue('Days')
})).filter(x => x.templateTypes.includes(parentType[0].id))
// Create the child records and sort them so that they are in order
let createRecords = types.map(c => ({
fields: {
[childNameInChild.name]: c.childName,
[parentFieldInChild.name]: [selectedEvent],
[childOrder.name]: c.templateOrder,
'Status': c.templateStatus,
'Due Date Calculation Number': c.templateDueDays,
'Notes': c.templateNotes
// Add additional template fields here and in section above using format below.
// Field names on the left should match field names in child table.
// Field names on the right following c. should match names created in section above that starts at line 72.
// 'Phase':c.templatePhase,
// 'Days': c.templateDays
}
