(Example) Configure an Excel Write Activity
This example shows how to configure an Excel Write activity to change the values of cells in a Microsoft Excel file based on data entered in an eForm.
Background and Setup
Result
This example shows how to add and configure an Excel Write activity in the Sales Invoice app to change the values of cells in a Microsoft Excel file based on data entered in an eForm.
When you create the Microsoft Excel file, it looks like this:
Prerequisites
- This example uses the Sales Invoice app from
the AgilePoint NX App Store.
For more information, refer to How to Get the App
- Create an access token for
Google Drive. In this example, the access token name is Write Excel Data.
For more information, refer to Access Token for Google Drive.
- You must have Google account.
- Upload your Microsoft Excel file — Sales Invoice.xlsx in this example — to the Google Drive folder you want to use for your app.
- Create a folder in Google Drive to save the completed Sales Invoice.xlsx Microsoft Excel file. In this example, the folder name is Sales Invoice Result.
Good to Know
- The Sales Invoice app is a process-based app that creates an invoice for a sale.
For the use case in this example, this app provides a form to enter information required for the invoice. The invoice request is then routed to the Excel Write activity to populate the Microsoft Excel file Sales Invoice.xlsx with information about the customer that is entered in the eForm.
- This topic uses the Excel Write activity in the Document tab. There are also versions of the Excel Read and Excel Write activities in the SharePoint tab. In general, examples are not provided for most third-party intergrations, including SharePoint. For information that is specific to the SharePoint versions of these activities, refer to Where Can I Find Information and Examples for Third-Party Integrations?
Step 1: Create a Microsoft Excel Template File
First, create and configure a Microsoft Excel file to save the data from an eForm.
Good to Know
- This app uses the same Microsoft Excel file at design time and runtime.
How to Start
- Open Microsoft Excel.
- Click Blank workbook.
- Save an Excel file with the file name Sales Invoice.xlsx.
Procedure
- In the Sales Invoice.xlsx file, enter the column names in this table:
Column Names Account Name E-mail ID Phone Cutomer PO Number PO Amount Payment Terms - Name the cells where you want to store the data from the eForm.
Each cell where you want to store data must have a name. For this example, use the names shown in this table.
Cell Name A2 AccountName B2 EmailId C2 Phone D2 CustomerPoNumber E2 PoAmount F2 PaymentTerms - Select the cell A2.
- To name the cell, in the Name Box, enter AccountName.
- Repeat these steps for each cell.
Step 2: Configure an Excel Write Activity
Next, add and configure an Excel Write activity.
How to Start
- Click Build Apps .
- On the Application Explorer screen, on the My Application pane, click Sales Invoice > Processes > Sales Invoice > Process Model > Sales Invoice.
Procedure
- On the Document tab, drag the Excel Write activity onto your process.
- On the General Configuration screen, in the Display Name field, enter Write Sales Invoice Excel.
- Click Next.
- On the Source Repository screen, select Google Drive.
- Click Next.
- On the Design Time Template Configuration screen, in the Google Drive list, select Write Excel Data access token.
- In the File Path section, select Choose File Path > Sales Invoice.xlsx.
As a prerequisite, Sales Invoice.xlsx must exist in Google Drive.
- Click Next.
- On the Runtime Repository screen, select Google Drive.
- On the Runtime Template Configuration screen, in the Google Drive list, select Write Excel Data.
- In the File Path section, select Choose File Path > Sales Invoice.xlsx.
- Click Next.
- On the Target Repository, select Google Drive.
- On the Target Repository Configuration screen, in the Google Drive list, select Write Excel Data.
- In the File Path section, select Choose File Path > Sales Invoice Result folder.
The Sales Invoice Result folder stores the result of the Sales Invoice.xlsx Microsoft Excel file.
As a prerequisite, the Sales Invoice Result folder must exist in Google Drive.
- Click Next.
- On the Excel Write Configuration screen, in the Save To, in the Enter File Name field, enter Result Sales Invoice Excel.
The Result Sales Invoice Excel is a file name used to save the result of the Sales Invoice.xlsx Microsoft Excel file.
- In the Fields Mapping field, click Schema Mapping .
- On the Schema Mapper screen, map the form fields to the cells in the Excel file as shown in this table.
These entity fields are associated with form controls in the Sales Invoice app.
Form Fields Excel Template Cell Name AccountName__u AccountName CutomerPONumber__u CutomerPoNumber EmailId__u EmailId PaymentTerms__u PaymentTerms Phone__u Phone POAmount__u PoAmount - Click Finish.
The Process Builder shows with the Excel Write activity.
Step 3: (Optional) Complete the Process
Next, save and validate your process model.
Procedure
- To validate a process, refer to Validate a Process.
- On the Save quick menu, click Save and Check In .
Step 4: (Optional) Publish and Run the Application
Next, publish the application so people can use it.
Procedure
- To publish the app, refer to Publish a process-based application.
- To run the app, refer to Start your process.
- Complete your Sales Invoice Request form and submit the form.
- Go to Google Drive, and open the Sales Invoice Result folder >
Result Sales Invoice Excel file.
As a prerequisite, the Sales Invoice Result folder must exist in Google Drive.
When you open the Result Sales Invoice Excel file, it shows the data from the Sales Invoice Request form.
How to Get the App
This example is based on the Sales Invoice app from the AgilePoint NX App Store. Use this procedure to get the app.
Prerequisites
- AgilePoint NX OnDemand (public cloud), or AgilePoint NX PrivateCloud or AgilePoint NX OnPremises v7.0 or higher.
Good to Know
- This procedure is optional. It is provided so you can test the example with an out-of-the-box app.
- This is part of the Background and Setup procedures, but many users preferred this step to appear after the example, not before it.
Procedure
- Click App Store .
- In the CATEGORY section, click Sales.
- Click the Sales Invoice app.
- On the Sales Invoice screen, click Add.
- On the Trust App screen, click Trust it.
- Click Return to site.