Variable interpolation

Variable interpolation

Variable interpolation

Make values “dynamic” by using our interpolation syntax.

Variable interpolation is made available in many places within Basedash where we allow you to specify certain variables that will be replaced with values depending on the context. An easy way to know if you can using interpolation is by looking for the double curly braces within an input field {{ }} . The double curly brace button will also show you what values you can use for interpolation.

image

Interpolation syntax

If you have an interpolation variable of username that is available, then you may write something like Hello, {{ username }}. How are you? . In this case, {{ username }} will be replaced with the value provided for username .

Use cases

Here are a few examples of interpolation in Basedsash

View display images

You may have a view where you are able to formulate an image URL based on a record’s values. You would be able to interpolate the record’s values to form an image URL that will be used as the display image for each of your records.

If your view is made up of attributes from a “User” database table, then you would be able to interpolate the value of a user’s ID to form an image URL. e.g. https://my-image-domain.com/users/{{ User.id }}/avatar.jpg .

image

Action inputs

Within Basedash actions, you can use variable interpolation for an action’s user inputs. If you were to setup a user input called username , then you could then configure an action’s body to use the user input using interpolation. For example, the action’s body could look like this: "Hello, {{ userName }}. How's it going?". In this case, when preparing an action to be run, you will be prompted to provide a value for username and that value will be used in the action body. If the value provided is “Robert”, then the body will be: "Hello, Robert. How's it going?” .

💠
https://www.basedash.com

© BaseDash Inc.