Skip to content

Instantly share code, notes, and snippets.

@MappingKat

MappingKat/block_2.js

Last active Nov 17, 2019
Embed
What would you like to do?
block-2.js
function createRecord(payload, done) {
payload.record = payload.data;
payload.record.form_id = "{FULCRUM SECOND FORM ID}";
// if you have a field that does not have the same element key for both forms then you can associate the fields
// with this line (I explain what this is for in more detail in the next block):
payload.record.form_values['{FULCRUM ELEMENT KEY}'] = payload.record.form_values['{FULCRUM ELEMENT KEY 2}'];
delete payload.data;
delete payload.record.id;
request({
method: 'POST',
url: 'https://api.fulcrumapp.com/api/v2/records.json',
json: payload.record,
headers: {
'X-ApiToken': '{API TOKEN}'
}
},
function (err, httpResponse, body) {
console.log('create', err, body);
});
done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.