Code Monkey home page Code Monkey logo

Comments (5)

sergey-safarov avatar sergey-safarov commented on June 15, 2024 2

Sorry for bothering you.
It looks like this because I have attached the filter flow which returns a limited dataset. I have disabled flow execution and the error disappeared.

from directus.

hanneskuettner avatar hanneskuettner commented on June 15, 2024

Do you have any flows that hook into item updates?

from directus.

sergey-safarov avatar sergey-safarov commented on June 15, 2024

I have rechecked the issue and it looks like it is related to the Read Data step.
I have created the flow on the screenshot.
image.
On the "Run Script" configured

module.exports = async function (data) {
	console.log(data);

    return data.$trigger.payload;
};

If you execute this flow, then the error will be reproduced.
If you delete Read Data step from the flow then JSON object will be printed into the log.

from directus.

hanneskuettner avatar hanneskuettner commented on June 15, 2024

That's probably because you have an invalid id variable string ({{ $trigger.keys[] }}). You need to drop the [].
Closing again, as this is a setup / flow problem and not a Directus Core problem. If you have any further questions to this don't hesitate to ask on our Community Discord Server.

from directus.

sergey-safarov avatar sergey-safarov commented on June 15, 2024

Thanks for the explanation.
I have tested {{ $trigger.keys }} and this does work. I got error message in the console

[12:54:45.930] ERROR: select "tenant"."id", "tenant"."user_created", "tenant"."date_created", "tenant"."user_updated", "tenant"."date_updated", "tenant"."name", "tenant"."status", "tenant"."user_owner", "tenant"."company_owner" from "tenant" where "tenant"."id" = $1 order by "tenant"."id" asc limit $2 - invalid input syntax for type uuid: "{"b5cc5154-4411-4658-bb88-dbd399e4e731"}"
err: {
"type": "DatabaseError",
"message": "select "tenant"."id", "tenant"."user_created", "tenant"."date_created", "tenant"."user_updated", "tenant"."date_updated", "tenant"."name", "tenant"."status", "tenant"."user_owner", "tenant"."company_owner" from "tenant" where "tenant"."id" = $1 order by "tenant"."id" asc limit $2 - invalid input syntax for type uuid: "{"b5cc5154-4411-4658-bb88-dbd399e4e731"}"",
"stack":

 "length": 135,
 "name": "error",
 "severity": "ERROR",
 "code": "22P02",
 "file": "uuid.c",
 "line": "134",
 "routine": "string_to_uuid"

}

It looks like ID compared with json object

invalid input syntax for type uuid: "{"b5cc5154-4411-4658-bb88-dbd399e4e731"}"",

Then I tried to use {{ $trigger.keys[0] }} and in this case, flow works as expected.

Question.
Should selectors {{ $trigger.keys[0] }} and {{ $trigger.keys[] }} works both?

from directus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.