Jump to content


Custom Payload for Button Object


3 replies to this topic

#1 Funnyman

    Member

  • Members
  • PipPip
  • 15 posts

Posted 19 March 2018 - 12:50 PM

Hi,

thank you very much for your swift action on my last feature suggestion.

A thing thats bothering me right now is the missing option of defining a custom payload for Button Objects that i send with an answer via API.
There is the "Tag" Property for your Response Object. But if a user clicks a button, die API only sends the "Return" value as Text.
I understand that it is easier this way because u can use the exact same process for reacting to the click of a button and submitting free Text. But i would find it very helpful to "hide" additional information in a button without passing that information verbatim through the chat-window.
In addition it would be nice to just leave the "Return" Property empty und identify the button that was clicked by its custom payload. I think its kind of irritating for u user to click a button and then see the statement of the Button pasted again to the chat-window. That feels redundant.

Again, thank you very much for your work.

Best Regards

#2 Patrick Keil

    Administrator

  • Administrators
  • 3632 posts
  • LocationSingen, Germany

Posted 20 March 2018 - 08:51 AM

Hi,

The TAG can be used in a persistent way.

Quote

die API only sends the "Return" value as Text.

The Tag set with your last response will be send back to your script with the next request. If you want to keep the Tag alive, push it back again and so on.

Quote

That feels redundant.

Thanks for your thoughts. We will consider to add an option to turn that off.

#3 Funnyman

    Member

  • Members
  • PipPip
  • 15 posts

Posted 21 March 2018 - 11:41 AM

Hi,

but as far as I know there is no correlation between the TAG and die Button that was clicked.
Lets say I display three buttons and i want to send back information depending on which button actually got clicked. Sure I can put that information in the return Value of the button. But again, displaying technical information in the chat window is not really an option.
The TAG will always be the same, no matter which Button gets clicked. It would be nice to have a custom payload for each Button, and to receive the custom payload of the clicked Button via the TAG in the next request.
This way there would not be the need to display a return Value in the chat Window. That could be optional, like the "block" property.

Best Regards

#4 Patrick Keil

    Administrator

  • Administrators
  • 3632 posts
  • LocationSingen, Germany

Posted 21 March 2018 - 12:30 PM

I don't see any problem you couldn't solve in your script.

You know what button has been clicked from the message value sent.
You can use complex json object as tag to store/update all kind of situation data.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users