Attributes basic question

(Augusto Vera) #1

To be honest, I have developed fairly complex chatbots with Flowxo, but the only thing I have not used is Attributes because it did not work as mentioned in the MEDIUM article: ](https://medium.com/flowxo/attributes-in-flow-xo-5189eefd8d01), today I decided to give it a try again but it does not yield the results mentioned in the article; first ask for a genre and mood and then set these results as attributes, then display them in a following message, only they show empty. Even when I get all the attributes before the message is displayed. I found a question to this but no one has answered it properly. I am trying to figure out of attributes could work like the #tags of ManyChat.

OK 2nd test: I have setup the response paths, for the set attribute action, but the values get messed up and do not reflect the latest attribute setting. even getting all the attributes before displaying them ¿?

OK 3rd test: The values reflect the immediate past triggered captured values, ¿how do I set it so that the ACTUAL flow values do get recorded in the attributes?

(Emi Akino) #2

@Augusto_Vera
As I understand, attributes are written by “Set an Attribute” in something like “cache” and when you read them from Trigger, they aren’t here yet. That’s why its output is empty. They are written (and could be read from there, obviously) to Trigger (to “actual flow values” by your words) when it triggers, i.e. when flow starts anew.
Before that attributes could be read from “cache” by “Get all Attributes” output.
This is how I understand Attributes principle of work.

PS. BTW, I agree, it’s not comfortable and requires a lot of additional actions every now and then. :worried:

(Emi Akino) #3

Also see here:

(Augusto Vera) #4

Taking this from a programmer standpoint is not very easy to understand, it seemed like an attribute worked like a variable, but I think I got the hang of it now.

(Augusto Vera) #5

BUT the article explainig attributes is plain wrong then, it should be actualized.

(Emi Akino) #6

@Augusto_Vera
Cool :+1: I understand your feelings as I have a bit of programming background too and also couldn’t get how it works.
Attributes are not variables, they are more like object properties, where this object is current user. So everything you set in attributes is assigned to him. There isn’t something similar to variables at this moment, unfortunately…

PS: some kind of lifehack. You can read ALL previously set attributes not only from “Get an Attribute”, but from “Set an attribute” too, because its output is collection of all set attributes. :wink:

2 Likes
(Augusto Vera) #7

Thanks Emi, to be honest I have done well without attributes so far but since I have to implement a human takeover it seems neccesary, so from what I see attributes also can persist among flows ¿right? attached to the response path. So that you can test the properties of attributes among connected flows right?

(Emi Akino) #8

[quote=“Augusto_Vera, post:7, topic:3005”]I have done well without attributes so far
[/quote]
How you did your flows completely without variables or something like it? I really miss them from the very beginning :sweat: Using attributes and metadata, but it’s just duct tape…
Yes, you’re absolutely righ, attributes are persistent between flows. They exist until you manually assign empty value to them.

(Augusto Vera) #9

Well, I have used a google sheet in the backend and pull any config data I need from there and also any environment variable I need between flows, it just feels more natural than attributes. I recently used an attribute to check that a user returned and guide them through a different path within the flow. What I learned is that attributes work like this:

When you set a new value, you just cannot call the value referring it by its name, it returns the empty value or past flow value, unless you “GET” the attribute, and then ask for the specific value of that block or step. ONLY THEN it reflects the correct value you just SET in the present flow. You could even ask for the value of the SET block or step and retrieve the present value. This is not very well explained in FLOWXO tutorials, but this is the way it works. It is handy when you want to flag something in the present flow and then ask for it in the next flow as reference.