#Independent queries in single flow

13 messages · Page 1 of 1 (latest)

young lance
#

Hi! I have a flow that runs two update data operations on a collection. The problem is that the second query seems to pick up the affected ids from the first query and ignores any filters on the second.

icy mantleBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please make sure your question includes the following:

  • An explanation of exactly what you're trying to achieve.
  • Any and all related code or previous attempts.
  • The exact issue or error you are facing.
  • Any screenshots if applicable.

When you're done with this thread, please close it.

(If you have a support agreement and need help, please contact the core team via email.)

jovial coral
#

Without more specifics, will be hard to help with this.

Have you checked to ensure you've got the filter rule setup correctly?

young lance
#
{
    "_and": [
        {
            "status": {
                "_eq": "draft"
            }
        },
        {
            "start_date": {
                "_lte": "$NOW"
            }
        },
        {
            "end_date": {
                "_gte": "$NOW"
            }
        }
    ]
}
{
    "_and": [
        {
            "end_date": {
                "_lt": "$NOW"
            }
        }
    ]
}
#

Here is the first and second query with the connections

#

This flow archives all items in the collection

#

Trying the second query in an insight pannel only returns a single item yet all items gets archived by the flow

jovial coral
#

So the main issue is with the second operation?

jovial coral
#

Unless you're specific passing the IDs to each operation, they're going to update all the items that match your filter rule.

#

So I think that might be where the problem lies

young lance
#

I think i'm confused on how update data works, manually triggering just the second query still archives everything

jovial coral
#

so the Query there is just a filter rule that is selecting the items to update

#

so in your example, everything that has a end_date that is less than (before) the current time – the status will be updated to archived