#Update not working

6 messages · Page 1 of 1 (latest)

carmine turret
#

Good morning,
We are trying to do an update with the flow module.
Insert and reads are working, but the update fails.

We have a collection of zones and we want to update the names of the first two.
Currently the names of the first two zones is Rome and Oslo.
And we want to change them to Paris and Amsterdam.

What are we doing wrong?

haughty jasper
#

You can only update one item with unique data or multiple items with identical data (for example update all items to published). So you'll have to update this into 2 separate updates.

carmine turret
#

Hi Brainslug,
Can we make a loop for that?
Because we do not know how many zones and updates we receive?

For example:
Lets take the product table.
We have around 300 products and we want to import them daily into Directus.
Because the prices can be updated. And then we need to update all 300 products.

haughty jasper
#

If you build an array of items to update like you have in the "payload" then you can pass that to a "trigger flow" operation that will run the second flow for each item in the array passed to it