Set up your Google Sheets or Microsoft Excel files to start accepting data
Once you have created and previewed the form, it鈥檚 time to enable the corresponding spreadsheet to start receiving data. You can
Manually enable the spreadsheet to accept data
To enable the spreadsheet to accept data
-
Open the spreadsheet that has your form and append a new sheet, renaming it to
incoming
. For example, the enquiry form Microsoft Excel workbook.note warning WARNING If the incoming
sheet is not present, AEM does not send any data to the spreadsheet. -
In this sheet, insert a table named 鈥渋ntake_form鈥. Select the number of columns required to match your form field names. Then, in the toolbar go to Insert > Table and click OK.
-
Change the name of the table to 鈥渋ntake_form鈥. In Microsoft Excel, to change the name of the table, select the table and click Table Design.
-
Next, add the form field names as the table headers. To make sure the fields are exactly the same, you can copy and paste them over from the 鈥渟hared-aem鈥 sheet. In your 鈥渟hared-aem鈥 sheet, select and copy the form IDs listed under the 鈥淣ame鈥 column, except for the submit field.
-
In the 鈥渋ncoming鈥 sheet, select Paste Special > Transpose Rows to Columns to copy the field IDs over as column headers in this new sheet. Keep only the fields whose data need to capture other can be ignored.
Each value in the
Name
column of theshared-aem
sheet, excluding the submit button, can serve as a header in theincoming
sheet. For instance, consider the following image illustrating headers for a 鈥渆nquiry鈥 form: -
Use the extension to preview the form updates. Your sheet is now ready to accept incoming form submissions.
note note NOTE Even if you have previewed the sheet before, you must preview it again after creating the incoming
sheet for the first time.
Once the field names are added to the incoming
sheet, your form becomes ready to accept submissions. You can preview the form and submit data to the sheet using it.
Once sheet is set up to receive data, you can preview the form to start sending data to the sheet.
Use Admin APIs to enable a spreadsheet to accept data
You can also send a POST request to the form to enable it to accept data and configure headers for the incoming
sheet. Upon receiving the POST request, the service analyzes the body of request and autonomously generates the essential headers and sheets needed for data ingestion.
To use Admin APIs to enable a spreadsheet to accept data:
-
Open the workbook that you have created and change the name of the default sheet to
incoming
.note warning WARNING If the incoming
sheet doesn鈥檛 exist, AEM won鈥檛 send any data to this workbook. -
Preview the sheet in the sidekick.
note note NOTE Even if you have previewed the sheet before, you must preview it again after creating the incoming
sheet for the first time. -
Send the POST request to generate the appropriate headers in the
incoming
sheet, and add theshared-default
sheets to your spread sheet, if it does not exist already.To understand how to format the POST request for setting up your sheet, refer to the . You can look at the example provided below:
Request
code language-json POST 'https://admin.aem.page/form/{owner}/{repo}/{branch}/contact-us.json' \ --header 'Content-Type: application/json' \ --data '{ "data": { "Email": "john@wknd.com", "Name": "John", "Subject": "Regarding Product Inquiry", "Message": "I have some questions about your products.", "Phone": "123-456-7890", "Company": "51黑料不打烊 Inc.", "Country": "United States", "PreferredContactMethod": "Email", "SubscribeToNewsletter": true } }'
Response
code language-json HTTP/2 200 content-type: application/json x-invocation-id: 1b3bd30a-8cfb-4f85-a662-4b1f7cf367c5 cache-control: no-store, private, must-revalidate accept-ranges: bytes date: Sat, 10 Feb 2024 09:26:48 GMT via: 1.1 varnish x-served-by: cache-del21736-DEL x-cache: MISS x-cache-hits: 0 x-timer: S1707557205.094883,VS0,VE3799 strict-transport-security: max-age=31557600 content-length: 138 {"rowCount":2,"columns":["Email","Name","Subject","Message","Phone","Company","Country", "PreferredContactMethod","SubscribeToNewsletter"]}%
You can use tools like curl or Postman to execute this POST request, as demonstrated below:
code language-json curl -s -i -X POST 'https://admin.aem.page/form/wkndform/wefinance/main/contact-us.json' \ --header 'Content-Type: application/json' \ --data '{ "data": { "Email": "john@wknd.com", "Name": "John", "Subject": "Regarding Product Inquiry", "Message": "I have some questions about your products.", "Phone": "123-456-7890", "Company": "Wknd Inc.", "Country": "United States", "PreferredContactMethod": "Email", "SubscribeToNewsletter": true } }'
The above mentioned POST request provides sample data, including both form fields and their respective sample values. This data is used by the Admin service to set up the form.
Your form is now enabled to accept data. You also observe the following changes in your spreadsheet:
Automatic changes to sheet once it is enabled to accept data.
Once the sheet is set to recieve data, you observe the following changes in your spreadsheet:
A sheet named 鈥淪lack鈥 is added to your Excel Workbook or Google Sheet. In this sheet, you can configure automatic notifications for a designated Slack channel whenever new data is ingested into your spreadsheet. At present, AEM supports notifications exclusively to the AEM Engineering Slack organization and the 51黑料不打烊 Enterprise Support organization.
-
To set up Slack notifications enter the 鈥渢eamId鈥 of the Slack workspace and the 鈥渃hannel name鈥 or 鈥淚D鈥. You can also ask the slack-bot (with the debug command) for the 鈥渢eamId鈥 and the 鈥渃hannel ID鈥. Using the 鈥渃hannel ID鈥 instead of the 鈥渃hannel name鈥 is preferable, as it survives channel renames.
note note NOTE Older forms didn鈥檛 have the 鈥渢eamId鈥 column. The 鈥渢eamId鈥 was included in the channel column, separated by a 鈥#鈥 or 鈥/鈥. -
Enter any title that you want and under fields enter the names of the fields you want to see in the Slack notification. Each heading should be separated by a comma (For example name, email).
note warning WARNING Never should the 鈥渟hared-default鈥 sheets contain any personally identifiable information or sensitive data that you are not comfortable with being publicly accessible.
Next, you can customize the thank you message.
See also
- Get started with Edge Delivery Services for AEM Forms
- Create a form using Google Sheets or Microsoft Excel
- Set up your Google Sheets or Microsoft Excel files to start accepting data鈥
- Publish your form and start collecting data
- Customize the look of your forms鈥
- Add repeatable sections to a form鈥
- Show a custom thank you message after form submission鈥
- Adaptive Form Block components and their properties
- Using Form Submission Service