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

In some special business use cases, you might need to add metadata during the File Upload.

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 would like 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 prior to the File Upload. When providing them in the FMAW code, please use as a value the api_key. 
    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 of the configured languages.

    Example: If languages "en", "fr", "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 need help with the configuration of FMAW, please contact us and provide the following in the ticket:

  • your Company name
  • Filerobot token
  • your question / what you would like to achieve
  • your sample FMAW code
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.