Integration with Google Sheets
Set up automatic file creation when Google Sheets is modified. The data will be sent to DiMaker to create files. If necessary, the sending status and a link to the finished file can be returned to the Google sheet.
Google Sheets
Create a table with personal data. You can use Google Forms or any other third-party services to add data to the table. Files will be created immediately after the Table is modified. To verify, add a couple of rows to the Table. The first line can be a header or the table can be made without a header.
Google Sheets with data for automatic import into DiMaker
Above is an example of Google Sheets, which stores data from Google Forms. The number of rows and columns can be anything.
Document in DiMaker
Create a document in DiMaker. In the places where personal data from the table needs to be inserted, write variables, such as %full name.
Once everything is ready, switch to the table, press "Load from Google Sheets" and in the window that appears, select the "Automatic Import" tab.
Open document with variable %full name and menu "File" - "Automatic Import".
Next, in the modal window that appears, you need to carefully configure the data import settings.
Automatic Import settings window from Google Sheets
- Google Sheets URL Link to Google Sheets from the browser window. You do not need to set "Access by link" not required.
- Variables Specify which column in Google Sheets contains variables from the document. If you enable the "Required" switch, file creation will not start until the corresponding cell is filled. It is recommended to enable for all cells, without which creating a file does not make sense, such as name or email address.
- Return status The sending status of the file will be displayed in the specified table column. The column must be empty and not intersect with the data. The possible statuses are "Created", "Sent", "Delivered", "Error."
- Return link to file The link to the finished file will be inserted into the specified table column. The column must be empty and not intersect with the data.
- Return Google Drive link The link to the file in your Google Drive will be inserted into the specified table column. The column must be empty and not intersect with the data. In the Drive sync menu, you need to allow syncing with Google Drive. Since synchronization takes some time, the file link will appear on the next launch.
- Return number A unique generation number will be inserted into the specified table column. The column must be empty and not intersect with the data.
- Ignore the first row Check the box if there is a header in the table (such as when using a form, as shown in the screenshot above).
In addition, you need to configure file creation parameters.
Automatic import settings window from Google Sheets
- Folder in Drive where files will be created. The folder must be created in advance. For example, by the name or date of event.
- Mail template for mailing. Email templates are located in "Letters" - "Templates."
- Send emails - the time when to start the mailing. It is recommended to "Send emails after all files."
Apps Script in Google Sheets
The last step of the setup is to add the export script and trigger in Google Sheets. To do this, go back to the Google Sheets where you'll be making the import and select "Add-ons" - "Apps Script".
Google Sheets window - "Add-ons" menu - "Apps Script"
In the pop-up window, paste the following code:
Show code
What is this code? This code gets all data only from the current sheet (where it's inserted) and sends it to DiMaker in JSON format. After receiving the response, it inserts links to the ready files in the respective cells. The script doesn't have access to other documents or to Google Drive.
Paste this code into the script editor (replacing what's already there). Name your script as you wish, for example, DiMaker.
Google Apps Script editor window
Click on "Save project" on the tool panel and then, after saving, "Run".
Google Apps Script editor window - "Run" button
A permissions check window will appear.
Security prompt modal window
After selecting an account, Google will warn you that the script is unverified.
A warning that the script is unverified
This security prompt warns you that the script you've pasted hasn't been reviewed by Google. However, you can trust that your data is safely stored. The script you're using only gets data from the current sheet and sends it to DiMaker to create files. It doesn't have access to other sheets or files in your Google Drive. We care about the safety of your data and confidentiality.
Select "Advanced" and "Go to DiMaker".
A warning that the script is unverified
A permissions request window will appear.
Permissions request window
After granting permission, the Apps Script window will open again and you need to click "Run" again.
Google Apps Script editor window - "Run" button
Then open the sheet tab. If everything was done correctly, the files will be created and sent to your email. The table will display the status of creation and sending, and a link to the ready file (if the respective columns were specified).
Google Sheets with the import result in DiMaker
If the file wasn't created, you need to check all the settings in the DiMaker document and try running the function again in Apps Script. Make sure that the link to the Google Sheets is correct and that the variables and data columns are specified, and so on.
Adding Triggers in Apps Script
The last step is to add triggers in Apps Script. To do this, you need to go back to the Apps Script tab (or open "Tools" - "Script Editor" again). Then you need to go to the "Triggers" page and click "Add Trigger".
Triggers window in Apps Script - adding a trigger
You can leave all the parameters as they are. In the "Select event type" field, you need to specify the required event.
- If you enter data manually in the table - then "On change".
- If you use forms - then "On form submit".
When you add this trigger, a permissions window will appear.
Adding a trigger window in Apps Script
Please do not use the "On change" and "On form submit" triggers simultaneously. You can add any one of them.
In addition, if you want to receive the status of file sending in the table, add a time-based trigger. To do this, in the Add Trigger window, select "Event source" - "Time-driven", and "Trigger type" - "Hour timer". Interval - "Every hour". Please do not set the sending frequency more often. Once an hour is enough. Ultimately, the trigger window may look like this:
Triggers window - "Time-driven" and "On form submit"
That's it. Just test the form or manually make changes to the Google Sheets fields.
You are amazing! You have set up the automatic creation of files from Google Sheets!
Frequently Asked Questions
How long does it take to create a file? Up to five seconds. The link to it appears immediately in the Google Table as soon as the trigger is activated. If you follow the link, you will receive the file, and if it does not yet exist, an error 404 will be displayed. If several lines are added simultaneously, files will be created one by one. In this case, the file will be created in a second + 10 seconds to complete the operation.
Why are files not being created? Check that you have granted permissions and that everything is set up correctly in DiMaker. Open the "API" section in DiMaker. If there are no requests there, then something is set up incorrectly on the Google Sheets side. If there are requests but no files are being created, then the problem is with the DiMaker setup. If you have any problems, please contact us.
How much does it cost to use? The same cost as regular creation. Tariffs can be viewed in the billing. It doesn't matter whether the file is created manually or automatically.
What happens if the data in the rows are the same? The file will not be created. A hash is created for each Google Table + DiMaker Document + row. If a file with such a hash has already been created, then only a link to it will be given in the table. The file itself will not be recreated. But if you delete the file from the Disk and clear the trash, the file will be recreated.
What happens if I delete the files that have been created? If automatic import is enabled, the files for the rows will be recreated. Thus, if you need to delete files, you should either turn off automatic import or clear the source table before deleting files from the Disk.
What do the statuses mean? The statuses returned to the table mean the following:
Created - the file was sent for generation and will be created in the nearest future.
Sent - the email with the file was sent to the recipient's postal service.
Delivered - the recipient's postal service received and delivered the email to the mailbox.
Opened - the email was opened, the file was most likely downloaded.
How quickly is the status updated? The status is updated each time the trigger is activated - i.e. when the change or form submit + on time - once an hour.