afterRun()

in src/extensions/sheets-extension.js [73:94]


  afterRun(context, options) {
    let source = context.source;
    let result = context.result;

    if (result) {
      // Format createdDatetime
      if (result.createdTimestamp) {
        result.createdDatetime = SheetsHelper.getFormattedDate(
          new Date(result.createdTimestamp), this.userTimeZone, 'MM/dd/YYYY HH:mm:ss');
      }
      // Format modifiedDatetime
      if (result.modifiedTimestamp) {
        result.modifiedDatetime = SheetsHelper.getFormattedDate(
          new Date(result.modifiedTimestamp), this.userTimeZone, 'MM/dd/YYYY HH:mm:ss');
      }

      // Set default values if there's no value assigned for specific properties.
      Object.keys(this.defaultResultValues).forEach(key => {
        if (!result[key]) result[key] = this.defaultResultValues[key];
      });
    }
  }