Create expense reports directly from email receipts
Allow your employees to directly import expense report information from their email.
Last updated: July, 2019
Simplify how your employees do expense reporting with a Gmail Add-on and Google Sheets. Anytime a user receives an email receipt, they can open the add-on which automatically contains relevant information about the expense. Users can edit that information and then submit the form to log their expense into a spreadsheet.
- Use the Card Service for Gmail add-ons to build a UI to works both on web and mobile.
- Store user values using Google Apps Script's Properties Service.
First, create the script:
- Click here to open the bot code in the Apps Script code editor.
- Click the menu item File > Make a copy to get your own copy. You can later access this copy in the G Suite Developer Hub.
Next, deploy the add-on:
- Select View > Show manifest file, which opens a file titled
- Select Publish > Deploy from manifest.
- Next to the entry Latest Version (Head) click Get ID.
- Select and copy the Deployment ID value.
- Close the dialog and the Deployments window.
- Open the Gmail add-on settings tab.
- In the Add-ons tab, ensure that you have selected the Enable developer add-ons for my account checkbox.
- Paste your add-on's deployment ID into the Developer add-ons textbox and click Install.
- In the Install developer add-on dialog that appears, click the checkbox to indicate that you trust this developer (yourself), then click Install.
Test it out and create a new expense report:
- Open any message in Gmail, either on web or mobile.
- A new button that resembles a receipt should appear on the right or bottom of your screen, depending on your platform.
- Click the button to authorize the add-on and follow the prompts.
- Open an email and fill out the receipt information and click New Sheet.
- Open your Google Drive to view the new expense report.
To learn more about making this add-on, follow this codelab for detailed instructions on each step.
You can also view the full source code of this solution on GitHub to learn more about how it was built.
Were you able to get the solution up and running?
If you have an idea for another solution you'd like to see featured in our gallery submit a request on the GitHub issue tracker.