Skip to main content
Answer

Create records for multiple templates - add fields

  • May 18, 2022
  • 8 replies
  • 69 views

Forum|alt.badge.img+8

Hi there, I copied this script from the scripting app. I tried to search in topics already but I am going around in circles and still getting errors.

I want to copy two fields additional fields from my task template to my tasks. The fields are called Status and Stage. The fields are same names in both tables. They are single select. Can someone help.

I added these following lines based on info I could find in topics but I am still receiving “Error: x: Can’t create records: invalid cell value for field ‘Status’. Could not find a choice with that ID or name at main on line 126”

Best answer by TheTimeSavingCo

Thanks so much for your quick reply Adam, I have double checked and cannot seem to find any difference between the two…

Stage

Status


Ah hmm

Could you replace the following two lines:

'Status': {name: 'Status'},
'Stage': {name: 'Stage'}

with:

'Status': {name: c.templateStatus},
'Stage': {name: c.templateStage}

And let me know if that helps?


Here’s a base with a script that works for creating child tasks with the single select field option in case my suggestion doesn’t help

8 replies

TheTimeSavingCo
Forum|alt.badge.img+31

Hm, in the “Status” and “Stage” fields in the child table, do all the same select options exist?

For example, in the screenshots below, the select options that exist in the Stage field of the Template table all exist in the Stage field of the Child table

I believe this error could be occuring as the Stage or Status field of the Child table does not contain options that exist in the same fields in the Template table, and so once the options are created you should be good to go


Forum|alt.badge.img+8
  • Author
  • Known Participant
  • May 18, 2022

Hm, in the “Status” and “Stage” fields in the child table, do all the same select options exist?

For example, in the screenshots below, the select options that exist in the Stage field of the Template table all exist in the Stage field of the Child table

I believe this error could be occuring as the Stage or Status field of the Child table does not contain options that exist in the same fields in the Template table, and so once the options are created you should be good to go


Thanks so much for your quick reply Adam, I have double checked and cannot seem to find any difference between the two…

Stage

Status


TheTimeSavingCo
Forum|alt.badge.img+31

Thanks so much for your quick reply Adam, I have double checked and cannot seem to find any difference between the two…

Stage

Status


Ah hmm

Could you replace the following two lines:

'Status': {name: 'Status'},
'Stage': {name: 'Stage'}

with:

'Status': {name: c.templateStatus},
'Stage': {name: c.templateStage}

And let me know if that helps?


Here’s a base with a script that works for creating child tasks with the single select field option in case my suggestion doesn’t help


Forum|alt.badge.img+8
  • Author
  • Known Participant
  • May 18, 2022

Ah hmm

Could you replace the following two lines:

'Status': {name: 'Status'},
'Stage': {name: 'Stage'}

with:

'Status': {name: c.templateStatus},
'Stage': {name: c.templateStage}

And let me know if that helps?


Here’s a base with a script that works for creating child tasks with the single select field option in case my suggestion doesn’t help


Adam, sir, you are a genius, thankkkkkk you! I wish I posted this earlier instead of suffering a minor breakdown trying to work it out! haha


TheTimeSavingCo
Forum|alt.badge.img+31

Adam, sir, you are a genius, thankkkkkk you! I wish I posted this earlier instead of suffering a minor breakdown trying to work it out! haha


Hahaha glad I could help! Totally been there


Forum|alt.badge.img+2

@TheTimeSavingCo - I tried this solution, and it works for text values. I am struggling to drop in here the recordID of the template record to link the template to the child record. Any ideas how to do that? 



Forum|alt.badge.img+2

@TheTimeSavingCo - I tried this solution, and it works for text values. I am struggling to drop in here the recordID of the template record to link the template to the child record. Any ideas how to do that? 




TheTimeSavingCo
Forum|alt.badge.img+31


I assume `Task Overview`'s a linked field?

If so, try replacing `{name: c.templateRecordID}` with `[{name: c.templateRecordID}]`