Just as you make connections between units using a drag and drop feature on the Pipeline dashboard, you also use drag and drop to create mappings between attributes and parameters in the Mapping dashboard. This can only be done between Units for which you have already made a connection.
In this example we want to create mappings between the attributes in the Request unit and the available parameters in findVariantById.
Click a data source unit on the Pipeline dashboard to open the Mapping dashboard.
On the left are the attributes from a source unit. On the right are the available parameters as defined in the data source. In this case, findVariantById has a single object
variant_id which needs a value. This value we will get from the list of available attributes on the left using either drag and drop or in the formula editor. Let's use the formula editor to show how an attribute is referenced.
In the Formula editor, for this example we first enter the data source name, in this case
request. Then we want a
path object. Notice the key/value pair for that object appears in the preview. We then enter
variant_id. This gives us our required value.
We now have our mapped formula. Hovering over the dark green area under the path parameter displays a summary of the data sample. It includes the valuer, the formula and an Edit Formula button to open the Formula editor.
This simple drag and drop hides the complexity of creating the mappings.
You drag the attribute name over to an empty property area (dark green area) and release the mouse. If it is allowed, the mapping will occur automatically.
You can see how it was done by hovering over the value of the parameter to display the formula summary dropdown. This is shown above in the previous section. Clicking Edit Formula opens the Formula editor where you can modify this reference.
Click Done to close the Mapping dashboard.