Help

How to create a new record and populate a link field (assuming you have record ID)

Topic Labels: Scripting
Solved
Jump to Solution
545 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Kosta_Kondraten
7 - App Architect
7 - App Architect

I am creating a new record triggered by a script with the following code:

 
let newRecs = {};
newRecs[0]['id'] = 'recDYGIT7fj80tTAH';

await table.createRecordAsync({
'Start Date/Time': billTillDate,
'Contact': newRecs,
'Notes': 'New Record note'
});

I am getting the following error:
 

 

TypeError: Cannot set properties of undefined (setting 'id')
 
Can you please modify the script - assuming the record Id is correct - so I can populate my Contact link field?
 
Thank you!
1 Solution

Accepted Solutions
Kosta_Kondraten
7 - App Architect
7 - App Architect

Never mind fixed it with the following code:

await table.createRecordAsync({
'Start Date/Time': billTillDate,
'Contact': [{id: 'recDYGIT7fj80tTAH'}],
'Notes': 'Working!'
});
 
Closing issue now 

See Solution in Thread

1 Reply 1
Kosta_Kondraten
7 - App Architect
7 - App Architect

Never mind fixed it with the following code:

await table.createRecordAsync({
'Start Date/Time': billTillDate,
'Contact': [{id: 'recDYGIT7fj80tTAH'}],
'Notes': 'Working!'
});
 
Closing issue now