Output “fields” – now you see them… and not you don’t. What’s up with Flow mechanics?

By | November 11, 2020

You know how we can pick output fields from the Flow actions:

image

So, why is it that, for the flow below, “Filter Array” output is not presented in the same way it’s done for the “Get Rows” action? Even though I’m really just filtering on the results of the “Get rows”, so would not it be reasonable to assume both should have the same output? Yet, they don’t.

image

This might not be obvious, and, really, I had not thought about it till today, but this is where Flow mechanics kick in.

Every connector has a set of actions. Every action can tell the Flow what the output of that action is going to be. However, in order for the “Filter Array” action above to produce the same output as “Get Rows” (which is the input for “Filter Array”), that Filter Array action would have to be quite a bit more intelligent… I’m not sure if that’s even doable.

Otherwise, the outputs are just different, and there is no reason to expect that one action would have the same output as the other.

And what do we do about it? Well, we don’t panic and we start using expressions:

first(outputs(‘Filter_array’)[‘body’])[‘Make’]

Which would be the same as this:

outputs(‘Filter_array’)[‘body’][0][‘Make’]

image

It keeps throwing me off when I have to resort to this kind of expressions, but, come to think of it, it’s not that complicated.

If I wanted to get a bit of reassurance, I could have run the Flow once to look a the outputs, and, then, writing the expression above would have been straightforward:

image

Well, not sure it feels any better after this post, but I hope so. Have fun!

2 thoughts on “Output “fields” – now you see them… and not you don’t. What’s up with Flow mechanics?

  1. PAUL WINER

    Thanks for this.
    By the way, it looks like you have an extra right parenthesis. I assume you got an “invalid expression” on that.

    Reply
    1. Alex Shlega Post author

      Might not be the best screenshot ever:) It is a closing parenthesis for the “First(“.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *