Code Monkey home page Code Monkey logo

Comments (11)

janober avatar janober commented on August 26, 2024 2

I am actually right now in the process of writing documentation about how the data structure looks like and what variables and functions are available in the Function-Node.

from n8n.

janober avatar janober commented on August 26, 2024

Transformation nodes are definetly needed! Was not sure yet how they should work exactly, what they should do, how many should there be (one to do everything, different ones for numbers, strings, ..). Is probably worth checking out what other similar products like Node-Red, Zapier, Tray.io, parabola.io, integromat.com, ... are doing and what advantages and disadvantages it has.

If you have suggestions, ideas, ... would love to hear them! And if you are interested in implementing them even more.

from n8n.

Libermentix avatar Libermentix commented on August 26, 2024

Wouldn't the more generic FunctionItem work for that? That's what we use internally primarily to do transformations of data.

from n8n.

janober avatar janober commented on August 26, 2024

Yes, it would work for sure but sadly only for people that can code. It should however also be possible for none coders to do as much as possible. So having a node/nodes in place which allows them to do that would be great.

from n8n.

Libermentix avatar Libermentix commented on August 26, 2024

@janober true that.

I just wonder how a calculation node would look like that does not include any code to do the calculation. If I understood the requirement correctly it would be something like: "I have an amount in cents and I want to transform it into an amount in euros (math operations)". But its not mentioned explicitly. Hence, the possibilities for interpretation would be endless. So in my opinion there would need to be some elaboration on the requirements on what should be done with that calculation node:

  • I need math operations to transform numbers from cents to Euros (i.e. implementation would be divide by 100 and have a parameter for the decimal precision) <-- math transformation
  • When I have an email field I want the characters to be masked <-- string transformation

To be clear it's my personal opinion, I would very much favor a user-friendly approach, but I asked myself, if I could get started on implementing that issue, how should the functionality look like and right now I wouldn't be able to answer that.

Would an idea be to look at how Zapier has implemented it, they have

  1. Numbers
  2. Datetime
  3. Text
  4. Utilities

from n8n.

janober avatar janober commented on August 26, 2024

haha yes, that is the problem I am neither ;-)

It could similar to the "Set" node. Where people can add multiple values (here operations). Then there could be one field for the "property name" which should be transformed and another one for the "transformation to transform".

Or not being a node at all. Just being different functions that people can use in expressions and select in a proper expression-editor (which I would love to have anyway, the current one simply needs to be improved!). I think Integromat does something similar.

from n8n.

cyberpz avatar cyberpz commented on August 26, 2024

To anyone willing to solve in the meantime:
Learn basic operations on Strings and Numbers
on W3schools, using the funtionItem-node to transform your data in JS vanilla.

from n8n.

Libermentix avatar Libermentix commented on August 26, 2024

@Peppuz I think the biggest issue is not that people don't know Strings and Numbers (by the way w3schools is bad, use MDN instead please) but rather that n8n underlying data structure is not clear enough.

I for example know plenty of JS to get around with everything, however, understanding that you need to manipulate the item's .json property's containing object to actually yield a result, that was the biggest issue here.

from n8n.

Libermentix avatar Libermentix commented on August 26, 2024

Amazing, that'll help greatly.

from n8n.

janober avatar janober commented on August 26, 2024

Ok created now some documentation.

Information about the data-structure, in general, can be found here:
https://docs.n8n.io/#/data-structure

Information about the Function-Nodes here:
https://docs.n8n.io/#/nodes?id=function-and-function-item-node

Hope it makes things a little bit clearer.

from n8n.

RicardoE105 avatar RicardoE105 commented on August 26, 2024

Hey @gabrieligbastos, thanks for the feedback. You can go to our community https://community.n8n.io/ and request the calculation node.

from n8n.

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.