Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const data = JSON.parse(inputData.data);
- output = {};
- // Fill in fields
- output['Request ID'] = data.id;
- output['Request Name'] = data.name;
- output['URL'] = data.url;
- output['Due Date'] = data.due_date;
- output['Folder'] = data.folder_name;
- output['Share Link'] = data.share_link;
- output['Template Name'] = data.request_template_name;
- output['Owner'] = data.owner_name;
- output['Client Name'] = data.client.full_name;
- output['Company Name'] = data.client.company_name;
- output['Email'] = data.client.email;
- output['Phone'] = data.client.phone;
- var files = [];
- data.pages.forEach(page => {
- page.sections.forEach(section => {
- section.fields.forEach(({ name, values }) => {
- values.forEach((value) => {
- if (typeof value === 'string' && value.startsWith('https://api.contentsnare.com/rails/active_storage/blobs/')) {
- files.push(value);
- }
- })
- })
- })
- })
- output['Files'] = files.join(',');
Add Comment
Please, Sign In to add comment