You can set up conditional logic and apply it to the data mappings, to make them even more powerful. In this guide, we’ll go through how to set up logic for your data and apply it to both individual layers and components.

🔙 BACK

How to set up conditional logic

1. Go to your Mappings

If you haven’t already, you’ll need to start by creating your first mapping. Toggle to the Mappings tab to either start a new mapping or access the ones you’ve already saved.

access-mappings.png

2. Select a dataset and toggle to ‘Logic’

Select a dataset source to link toggle to the ‘Logic’ tab. Here you can set up your logic, with or without a condition. For example, if you only want to apply data that contains certain keywords, choose the contains option from the dropdown and then type the value or word that your data must contain.

add-logic-to-mapping.png

3. Apply your logic…

After setting up your logic in the dataset field on the left, you can then choose whether to apply this logic to specific layers, or to a component’s properties, on the right.

To a layer

Toggle to ‘Layer’ if you want to apply the logic to a specific layer.

To a component

Or, toggle to ‘Component’ to apply the logic to a component’s properties. Select the property to apply the logic to, which then gives you several options:

apply-logic-to-component.png

<aside> ℹ️ You can also apply data to a component’s properties without any logic. Simply follow the same steps but without setting up any logic for the dataset.

</aside>


D2D logo 256x256.png

Links

data.to.design

Chat with us

Help center

Getting started

Datasets

Conditional logic

Security

Google Sheet templates

Troubleshooting