Replies: 1 comment
-
|
Use the relationship field’s ID, not the plant’s ID. // Get all locations
const locations = $("steps.Query Locations.rows");
// Find locations that point to the current plant
const ids = locations
.filter(l => l.plant_id === $("loop.currentItem")._id)
.map(l => l._id);
// Return the array (empty if none)
idsThe expression must be a plain array of IDs; Budibase will write that into the Many‑to‑One relationship. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying for a week or more to replicate the steps found in issue #10899 to "import" a Relationship field. The interface has noticeably updated so some of the steps outlined aren't matching up to what I'm trying to do.
I have two tables:
LocationsandPlantsThe
Locationstable has several columns, but the two I'm concerned with are a text fieldLandmark Subtypeand the currently empty Many-To-OnePlantRelationship field.I also have a
Plantstable that has two columns:NameandImage URLHere's the layout of my automation along with the variables used:

Query Locations
LocationsLoop
{{ steps.Query Locations.rows }}Query Plants
PlantsUpdate Row
{{ loop.currentItem._id }}PlantThis returns an error, but runs through all iterations. I couldn't find any specific error message, but looking at the
Data Out, it looks like it's not injecting thePlantfield at all in the data structure of the returned row. If I have information in thePlantfield in the Locations table, it clears it.Beta Was this translation helpful? Give feedback.
All reactions