If you would like to filter a dataset to a particular value, you could apply a static filter when adding an embed filter to the dataset or when requesting an embed token! This will make sure that each embed user will only be able to access the filtered dataset.
The video below shows you how you can easily apply a static embed filter to your dataset!

Alternatively you can also specify these filters when requesting the embed token in your backend. Below you can find a Node.js code snippet of an 'is in' filter with one string value:

const Luzmo = require('@luzmo/nodejs-sdk');
var client = new Luzmo({
    api_key: '< Your API key >',
    api_token: '< Your API token >'
  });

let promise = client.create('authorization', {
  type: 'embed',
  access: {
  collections: [
   {
   id: '<collection ID>',
   inheritRights: 'use'
            }
      ]
  },
  username: '12345678',
  suborganization: 'Burrito Co.',
  name: 'Embed user',
  email : 'embed_user@luzmo.com',
  filters: [
    {
      clause: "where",
      origin: "global",
      securable_id: "< your dataset id >",
      column_id: "< your column id >",
      expression: "? in ?",
      value: [
        "< A value >"
      ]
    }
  ]
});

promise.then((result) => {
  // return the result to the client
});

In case you would like to dynamically decide what the dataset should be filtered to based on the user in your application, parameterizable filters are definitely an easier solution. This Academy article helps you on the way!

Previous
Next

Need more information?

Do you still have questions? Let us know how we can help.
Send us feedback!

Course Outline