Issue setting attribute

(Chris Kyriacou) #1

Hi,

I’m trying to use you send message to human flow, but I’ve replaced the send message to human with send email. That’s not the issue…

My issue is that after asking for their name, I use the set attribute module to set first_name from the response to asking for their name. I do the same for email.

In the send email module I’m trying the send the users first_name in the message box by typing {{user_wants_to_talk_to_a_human.attributes__first_name}}. However when the email is receive it is blank.

If then click send another, the second email contains the first name. It’s as thought the flow has to complete for the attribute to be set.

When I check the flow, I can see the attributes are being set but in the message they are blank.

Also I know I could just parse the answer, but I don’t want to do that because i’ve filtered the “ask name” question to only display if first_name hasn’t already been set by this or another flow

hope that makes sense, can you see what I am doing wrong?

(Karen Barker) #2

Hi Chris,

Attributes are stored on the response path, however, if you therefore update an attribute in a flow the response path isn’t updated again until another flow is triggered. If you want to use the updated attribute in the same flow you need to use a “Get Attribute” action first and then use the value returned from that in the email body.

Hope this makes sense. :slight_smile:

#3

Hi Karen, the “issue” with attributes is not only with updated attributes but with new attributes too, it’s not possible read attributes after first set, we need to read a new attributes in the same triggered flow not after a new flow is triggered or the second time the flow is triggered.
Is it not possible have an action that it does a set and get so we can read attributes and not the output of a get?

(Chris Kyriacou) #4

Hi,

I managed to get it working like you said Karen, but I have to agree with CaosMkt. It’s a proper long winded way of doing it. I mean you can see that the attributes has been set in the interactions, so why they cant be used is weird.

(Karen Barker) #5

Hey guys,

I do see where you’re coming from and yes Caos it is with any attribute set within a flow - update or new.

If you think about the flow in a linear way, it might make more sense.

  • When the flow is triggered the attribute either wasn’t created/was a particular value.
  • You then set/update the value.
  • Then you want to use the attribute - the only place to get the attribute from is the response path which is on the trigger message - using the {{trigger.attribute__attributeName}} variable. The important part to realise here is that the value is therefore coming from the point that the flow was triggered and not since the Set Attribute action. This is why we then need to add the Get Attribute in order to have a funtion available to pick the attribute up from.

I’ll certainly raise the thought of combining the set/get attributes into 1 task but I can’t promise whether or not this will get changed. :slight_smile: