Documentation
Feedback
Guides
API Reference

Guides
Master Datav1 Guides
Uploading files to Master Data

Learn how to upload files to Master Data v1.

In this guide, you will learn how to upload files to Master Data v1 by following these steps:

Step by step

Step 1 - Creating a new data entity

In this step, you will create a new data entity to represent a collection of files. This entity will include a file-type field dedicated to storing files.

  1. Access the DynamicStorage at https://{accountName}.ds.vtexcrm.com.br.

    Remember to replace the value between curly braces with your account name.

  2. Click Data Entities in the top bar.
  3. Click Add New.
  4. In the Acronym field, enter a two-letter acronym for the data entity you are creating.
  5. In Name, enter the name of the data entity that will store the PDF file (e.g., Files, PDFs).
  6. Go to the Fields tab. In the Name field, enter a new name for the field that will store the file in lowercase letters (e.g., filename).
  7. In Display Name, enter the data entity name chosen in Step 5, but with uppercase in the first letter (e.g., Files, Pdf).
  8. In the Type dropdown menu, select File.
  9. Click the "engine" icon Engine Icon on the right side of the Type field.
  10. Under the General settings section, select the Make readable without credential checkbox to make the data saved via this field available without the need for authentication.
  11. On Custom field type settings, select the Max size per file according to your needs. This sets the maximum file size that can be uploaded to this field.
  12. Click Save.

Step 2 - Publishing and indexing the data entity

As the next step, you will now publish and index your newly created data entity.

  1. On the Data Entities tab, find the data entity you created in the previous step and click the "blue disk" icon Save Icon on the left side of the line to publish the entity.
  2. Click Ok to continue.
  3. Click the "four arrows" icon Four-arrow Icon to reindex the data entity.

Wait for the data entity to be fully indexed. This may take from 30 minutes to one hour. During this time, do not make any changes to the data entity or its fields. Note that there is currently no interface to monitor the progress of indexation. Instead, you can periodically check the status of the entity.

Step 3 - Creating a Master Data form

Once your data entity is successfully indexed, you can proceed to create a form. This form will define how your data entity will be displayed and handled.

  1. After indexation is completed, access the Master Data CRM at https://{account}.vtexcrm.com.br.

    Remember to replace the value between curly braces with your account name.

  2. Click the Advanced settings tab.
  3. Click Formulários.
  4. Click Novo to create a new form.
  5. In the Nome field, enter the name of the formulário, which should be the same as the data entity name.
  6. In Entidade de Dados, select the data entity you previously created.
  7. In the Campos de Listagem tab, select the Id do Registro and the data entity you previously created.
  8. Change to the Schemas de Layout tab.
  9. Click the Incluir nova seção button to add a new section to the form.
  10. In the Nome field, enter a name for the section.
  11. Select the data entity previously created from the column Campos disponíveis. Then, drag and drop it into the column Campos da coluna 1.
  12. Click Save.

Step 4 - Uploading the file

Now, access the Master Data CRM at https://{account}.vtexcrm.com.br to upload your files.

Remember to replace the value between curly braces with your account name.

By now, when accessing the Master Data CRM, you should see a new tab with the name of the form you just created. If that's not the case, reload the page.

{"base64":"  ","img":{"width":1591,"height":271,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":65912,"url":"https://raw.githubusercontent.com/vtexdocs/dev-portal-content/main/docs/guides/Master-Data/v1-guides/form.png"}}

  1. Click the tab with the name of your new form.
  2. Click Novo.
  3. Click the Upload a File button. Choose your file and click Open.
  4. After the upload, click Save.

Step 5 - Accessing the file

Finally, after uploading your files, you can access and share their URLs by following these steps:

  1. In the Master Data CRM, click the tab with the name of your new form.
  2. Copy the Id do Registro value and save it. The Id do Registro value has the following pattern: {acronym}-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
  3. Assemble the file's public URL and use it to access the file. Use this pattern to assemble the URL: https://{account}.vtexcommercestable.com.br/api/dataentities/{acronym}/documents/{idWithouthAcronym}/{fieldName}/attachments/{file}, where:
    • acronym - Two-letter acronym that identifies the data structure
    • idWithouthAcronym - Id of the document, without the acronym, i.e., the XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX part from the Id do Registro value.
    • fieldName - Name of the field created in step 6 of Step 1 - Creating a new data entity.
    • file - Name of the file followed by its extension (e.g., myfile.pdf).
Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page