In ER there’s a not-so-well-known feature where you can add parameters to model nodes. When we use that node from the format, we can pass a parameter, and that parameter will be used by the mapping to get the value.
Sounds a bit complicated, but with the example below it gets much clearer:
Let’s say we have a product in the system, like a pineapple, and we’ve got some translations for it:

We want a report that shows the product name in a specific language, but that language will be decided in the format.
We might have multiple formats. One where the user always wants it in English, another in the system language, one in the user’s language, and maybe another in Chinese…
This is where parameters come in handy. They let us avoid pulling all the translations in the mapping when we only need one.
Let’s start with a simple model and add a single parameter:


Now in the mapping:

The table InventTable
has a method called productName
, and this method accepts a parameter for the language code:

Finally in the form this node will also ask for a parameter, in this case the language code:


Let’s test it:



Parameter lists
There’s an option to make the parameters a list. I can’t really imagine any real-world case where this would be useful… but anyways, just for fun, let’s test it!
Let’s say we want multiple translations of the name, but all in the same field. I know it’s not practical and there are much better ways. So from the format, we might want the name in just one language, or in multiple at the same time. Let’s try it.
In the model, let’s check the parameter as a list:

In the mapping, we use stringJoin
, which converts the elements of a list into a single string. But instead of using the element directly (the language code), we pass it through the InventTable.productName
method:

And in the format, we need a list. We can use Split
:

And we get:

Well, it works… If you know a better use for the param list, drop a comment. If not, this Jurassic Park quote feels appropriate:

Leave a Reply