'Adding multiple Notion relations in Integromat (Notion API)

Attempting to add multiple Notion relations in integromat:

  • Desired result: Both students are added to the database
  • Observed result: Each student is replaced with the iteration, so only the last the student is added to the database (not both)

Any guidance on how to manage this? enter image description here



Solution 1:[1]

I had this same problem while updating a "Relations" field in a Notion database with multiple Relations. The Iterator module is not needed.

Instead, in the "Update a Database Item" module, you can use the map() function in the destination field to process the "array of Collections" represented by the multiple student records as follows:

map(2.properties_value.students[]; id; id)

Additionally, if you would like to "append" another record to that result from another module, you can use the add() function as follows:

add(map(2.properties_value.student[]; id; id); 3.otherstudentid; 6.yetanotherstudentid)

It seems that Notion doesn't mind having duplicates in the relation field, as it ignores any extras it might receive.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 interplanetary