Skip to content

Commit 05286e0

Browse files
update example
1 parent e2a9d39 commit 05286e0

File tree

6 files changed

+556
-1043
lines changed

6 files changed

+556
-1043
lines changed
35.8 KB
Binary file not shown.

lib/eSignature/controllers/eg042DocumentGeneration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const api = API_TYPES.ESIGNATURE;
1818
const mustAuthenticate = '/ds/mustAuthenticate';
1919
const minimumBufferMin = 3;
2020
const demoDocsPath = path.resolve(__dirname, '../../../demo_documents');
21-
const docFile = 'Offer_Letter_Demo.docx';
21+
const docFile = 'Offer_Letter_Dynamic_Table.docx';
2222

2323
/**
2424
* Request a signature by email with document generation

lib/eSignature/examples/documentGeneration.js

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ const makeEnvelope = (templateId, args) => {
181181
*/
182182
//ds-snippet-start:eSign42Step7
183183
const formFields = (documentId, args) => {
184-
const docGenFormFieldRequest = docusign.DocGenFormFieldRequest.constructFromObject({
184+
const docGenFormFieldRequest = {
185185
docGenFormFields: [
186-
docusign.DocGenFormFields.constructFromObject({
186+
{
187187
documentId: documentId,
188188
docGenFormFieldList: [
189189
docusign.DocGenFormField.constructFromObject({
@@ -198,18 +198,44 @@ const formFields = (documentId, args) => {
198198
name: 'Job_Title',
199199
value: args.jobTitle
200200
}),
201-
docusign.DocGenFormField.constructFromObject({
202-
name: 'Salary',
203-
value: args.salary
204-
}),
205201
docusign.DocGenFormField.constructFromObject({
206202
name: 'Start_Date',
207203
value: args.startDate
208204
}),
205+
{
206+
name: 'Compensation_Package',
207+
type: 'TableRow',
208+
rowValues: [
209+
{
210+
docGenFormFieldList: [
211+
{
212+
name: 'Compensation_Component',
213+
value: 'Salary'
214+
},
215+
{
216+
name: 'Details',
217+
value: args.salary
218+
}
219+
]
220+
},
221+
{
222+
docGenFormFieldList: [
223+
{
224+
name: 'Compensation_Component',
225+
value: 'Bonus'
226+
},
227+
{
228+
name: 'Details',
229+
value: 'You will be eligible for a bonus of up to 20 percent based on your performance.'
230+
}
231+
]
232+
}
233+
]
234+
}
209235
]
210-
})
236+
}
211237
]
212-
});
238+
};
213239

214240
return docGenFormFieldRequest;
215241
};

0 commit comments

Comments
 (0)