Create a formule to link to a database with a one to many relationship

Hi,

I want to create an automation to link a product (from a product database) to an orderregel. Don’t want to use the autolink option, but with a formula inside an automation instead.

The automation I’m willing to use (inside orderregels) is:

  • If order is created
  • Then link to product, with formula: Products.Filter(Find([Step 1 Orderregel].Name,Name) > 0)

But I’ve discovered that I’m not able to use this formula using a one-many relationship. If I change the relation in a many-many relationship it works.

In our case a Orderregel can never contains more than one product. But a product can have many orderregels.

Changing the relation to many to many would solve the issue with the formula, but I’m curious to find out why it’s not working using a one-many relationship. And whether or not there may be a different formula which makes it possible to map if name contains in A - link it to a product that contains the same.

Thanks!

Products.Filter(Find([Step 1 Orderregel].Name,Name) > 0)

will return a collection of Products that meet the filter criteria. If you know there is only one such Product, you will need to explicitly choose it using

Products.Filter(Find([Step 1 Orderregel].Name,Name) > 0).Sort().First()

1 Like

Ah cool! Same like we’ve had before! Will make a special note for this.

Thanks