How to configure the Widget to add metadata on file upload?

You might need to add metadata during the File Upload in some special business use cases.

The FMAW module that is responsible for uploading file data is XHR Upload.

Its property meta can be used to add metadata to your file on Upload.

You can find an example of the FMAW implementation here.

Important notes:

  • Always ensure that the metadata fields you want to add during File Upload are already created in the Filerobot metadata structure. 
  • The values of fields with type SELECT-ONE and MULTI_SELECT should also exist in the metadata structure before the File Upload. When providing them in the FMAW code, please use the api_key as a value. 
    Screenshot 2024-01-26 at 19.36.29.png
    FMAW code:
    .use(XHRUpload, {
        meta: {
          title: {
            en: "Lorem Ipsum",
          },
          select_one: "summer",
          number: "123",
          multi_select: ["blue", "green"],
          boolean: true,
          date: "2024-01-26",
        },
      })

     

  • If a TEXT field is marked to have a Regional Group in the Metadata configuration, then the value should be provided as an object with keys for all configured languages.

    Example: If languages "en", "fr", and "de" are configured, then the TEXT fields having Regional variants should be supplied in the following way:
    title: {
          en: "This is title",
          fr: "C'est le titre",
          de: "Das ist der Titel"
    }

If you have any questions or issues, please feel free to contact our Software Engineer and mention the following details:

  • Token
  • Short description of the issue (including URLs, screenshots, short video if available)
  • Steps to reproduce the issue.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.