Assigning same attribute with different values for each user globally

#1

Greetings, Botmakers and FlowXO team!

Would be greatful if you help with the problem below :slight_smile:

While broadcasting a question I would like the answer to become attribute and be assigned to each user.
Globally.
So it could be easily refered to in another flow.

Questions are:
-how to auto-assign attribute for each user globally? (‘user 1 answer’ to ‘user 1’, ‘user 2 answer’ to ‘user 2’…‘user n answer’ to ‘user n’)
-how to refer to that attribute from another flow? (each user should refer to attribute that was assigned personally to him)

(Karen Barker) #2

Hi there,

Are you sending your question using the Ask A Question service? If so when the user responds with an answer, you can store that in an Attribute, using the “Set Attribute” task.

Attributes are globally accessibile from any flow running on the same response path. So you will be able to use the attribute value in any other flows and it will relate to the particular user

Hope this helps. If you need any further help then email in to support@flowxo.com with more information.

#3

Hi Karen,

Thanks, but I guess my issue is little deeper.
Maybe for better understanding I’ll describe in details what I’m working on.
Via broadcast-webhook different users are asked a question with choices - numbers from 0 to 6(0, 1, 2, 3, 4, 5, 6).
Bot sums their answers and stores this sum in global attribute. User 1 chose ‘4’, user 2 chose ‘5’ = 4+5= 9
Also I gave users ability to check the sum to the current time.
User checks sum and gets ‘current sum is 9’ (new flow: get attribute + send message with value).
Answers(though I’m not confident how to set this right - maybe its the key, don’t know) and sum are made global.
Now the tricky part.
I want to give user ability to change his answer and update the sum globally.
How I see it:
In the new flow I ask user: ‘Have you changed your mind? Give, please, new answer’ and again choices with numbers from 0 to 6.
Now bot subtracts ‘new answer’ - ‘old answer’ and adds result to ‘old sum’ = ‘new sum’.
And here is the problem: bot sees last entered ‘old answer’ - he takes ‘new answer’ from current user and subtracts ‘old answer’ from last answer given. So sum update can’t be made correctly :frowning:

Also there is problem #2 : values don’t want to be counted - I get values like ‘8+(1-5)’. It should be 4 though.

Would be extremely greatful to you if you help.

Kind regards