Article published on the 20th of April, 2023.
Contents
1. Case description
In WorkPoint, it is possible to use WorkPoint Automate to combine files into ZIP files. This can be done by using the "Compress to ZIP file" step in WorkPoint Automate. This step allows you to input one or more files and create a compressed ZIP file containing them.
This feature can be incredibly useful in when you need to send multiple files to a client or partner. By combining the files into a single ZIP file, you can simplify the process of sending them, as the recipient only needs to download one file instead of multiple files. This can save time and reduce the risk of errors that may occur when sending multiple files separately.
Additionally, ZIP files are a common way of compressing files for storage or transfer, as they can significantly reduce the file size without losing any data. This can be beneficial when dealing with large files or limited storage space.
In this article, we will describe how to create a simple WorkPoint Automate process which combines files selected in a library and compresses them into a single PDF file.
We will work with the following case:
As a project worker, I want to be able to select one or multiple files in my Documents library and select to compress them in a ZIP file. The process should allow me to type a name for the ZIP file before creating it. Additionally, the ZIP file should contain an index file with information about the documents being compressed, and a link to each document. Finally, the ZIP file should be saved in the same Documents library as the source files.
2. Implementation
We will start the implementation of the case mentioned by creating the WorkPoint Automate process to compress files. We will title it "Compress files in ZIP":
- To create the WorkPoint Automate process, in the Process Builder we click "New".
- In the "Create new" dialog, click "Start from scratch".
- In the "Title" field, type "Compress files in ZIP".
- In "Type", select "User Process". Optionally, you can place the process in a process group.
- When ready to create the process, click "Begin".
Next, we will add the first step, a Custom form, to the process:
- In the Process Builder, click "Add new steps".
- In the "Add a step" panel, search for and select the "Custom form" step.
- To add the step to the process, click "Add step".
This adds the Custom form step to the process:
On the Custom form, add a new field of type "Text" and configure it as follows:
- In the "Name" field, type "ZIPName". You can use this name to access the data in this field from the context later. In the "Title" field, type "ZIP name". This is the title of the field as displayed to the user of the form.
- Next, enable the "Required" property, so that users have to provide a name for the ZIP file before continuing.
Next, we are going to change some general settings of the custom form:
- In the "General" tab of the Custom form properties, change the display title of the form to "ZIP name".
- Provide an informative description about what this step does.
- In the "Name" field, type "ZipNameForm". This name is used to access the fields on the form later.
Next, add the "Compress to ZIP file" step to the process:
Next, configure the options of the Compress to ZIP file step as follows:
- In the "General" tab, in Step Input select "Selected Items".
Next, open the "Options" tab:
- In the "Destination business module" select any existing business module. We will reconfigure this field in a little while, for now, simply select any business module on your WorkPoint solution.
- In the "Destination entity" field, select the current entity ID.
- In the "Destination library", type in the name of the library you want to store the ZIP file in. In this instance, we store the ZIP file in the Documents library.
- In the "Output exists behaviour" field, we select the "Rename" option. This makes sure that if we already have a file in the Documents library with the same name as the ZIP file we are trying to create, we create the ZIP file with the name, and append a number to the end.
- In the "Add index" and "Add source information" fields, select "Yes".
Next, go to the "Fields" tab of the Compress to ZIP file step:
- Expand the "Name" field and focus the input field.
- From the process context, expand "ZipNameForm" and select the "ZipName" property. This is the property from the Custom form in the process.
Next, return to the "Options" tab in the Compress to ZIP file step:
- In the "Destination business module" field, remove the selection made previously and instead select the ID of the current business module from the process context. This will ensure that we can use this process across multiple business modules.
You can now save and publish the process. Once published, open the My Tools settings page in the WorkPoint Administration:
- In the My Tools settings page, we select the "Projects" business module and the "Documents" library.
- For the Documents library, we create a new My Tools button titled "ZIP files".
We configure the "ZIP files" button as follows:
- As mentioned, we title the button "ZIP files".
- In the "Type" field, we select "User Process".
- In the "Process" field, we select the process we just created, the "Compress files in ZIP" process.
- In the "Item Selection Requirement" field, we select "At Least One".
We can now save the My Tools button and clear the WorkPoint 365 browser cache.
This also concludes the configuration of both the process and the My Tools button. Next, we will look at how to run the process and compress multiple files in a single ZIP file.
3. Execution
Since we configured the My Tools button which runs the Compress files in ZIP process on the Documents libraries of projects, this is where the beginning of the execution demonstration begins.
We are currently located in the Documents library of a project titled "Project Orange". Let's select a couple of documents and compress them in a ZIP file:
- We have made a selection of the elements we want to compress in a ZIP file.
- To run the process, we click "Send to..." in the library command bar.
- In the "Send to"-menu, we can select the My Tools button we created to launch the Compress files in ZIP process.
- In the first step of the process, we can type in a name for the ZIP we are going to create. In this instance, we have named it "Compressed documents".
- Clicking the "Continue" button takes us to the next step of the process, which will actually create the ZIP for us:
Once the process is finished, we should see the following message:
Let's close the process and look in the Documents library again:
- In the Documents library, we can see that the ZIP file was generated. If we click it to open it, we can also see its contents:
Comments
0 comments
Please sign in to leave a comment.