Links for creating documents with suggested name and preselected properties

The “New document” form in MetaShare can be opened using a link to the workspace with special parameters added at the end of the URL. This allows saving frequently used property combinations and creating new documents with correct properties faster. Additionally, name field can be prefilled with a suggested value. This can be achieved by adding another parameter followed by the suggested name. These links can be bookmarked or included in other solutions, for example on intranet pages.

Format of the filename prefilled in the “New document” form:

Name field can be prefilled with any text, but to ensure unique filenames it should include special tokens which will be replaced with relevant values. Currently you can use the following tokens:

  • {template} – will be replaced with the name of the selected template
  • {date} – will be replaced with the current date
  • {time} – will be replaced with current time

For example, if suggested name is defined as “Some name – {template} – {date} {time}” and a template “Report.docx” is selected, the newly created file will be named “Some name – Report – 2023-01-10 15.11”.

Creating a document with suggested names:

Whenever a link to create a document is used, the workspace will open with the form to create a new document and prefilled with any values included in the link. The name field will contain suggested name and if any tokens were used, the name with replaced tokens will be displayed below the field:

If the suggested name contains {template} and no template has been selected yet, an error message will be displayed instead:

Building a link to the “New document” form:

Links can be built by adding $dialog=new and $filename=SuggestedName at the end of the URL of the workspace where documents should be created. To create a link follow these steps:

  1. Open the workspace where documents are supposed to be created and apply any filters that should be used as default values for new documents:
  2. Copy the link to the document view.
  3. If no filters were selected and URL doesn’t contain the “?” character yet, add this query string “?‍$dialog=new&$filename=” at the end of the link, else add &$dialog=new&$filename=”.
  4. Add your suggested filename after the “$filename=” query string. The complete link could then look something like this: https://app.metashare.com/3490a127-0702-4566-bbdf-f2da71901488/workspaces/5788?DocumentType=04e200ed-d009-4b5f-9cb9-dbbf916f8898&Project=2126a12f-e37e-4fae-8728-947a556c7517&Projectphase=7cdd2ea6-e9cf-40fa-95d8-8d758d8060a1&$dialog=new&$filename={template} – {date} {time}”.