Author Topic: Raise Event Block and Json String - Composer 8.1.4  (Read 2651 times)

Offline ymattica

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Raise Event Block and Json String - Composer 8.1.4
« on: March 24, 2016, 05:48:10 PM »
Hi,
System variable LAST_EVENT_MESSAGE  works only setting a simple string but not setting a Json Object ???
I'm testing a Raise Event Block on a voice application.
I created a custom event and throw it using the Raise Event Block
When I capture the event I am able tot read the LAST_EVENT_MESSAGE value only if I assign a simple string (for example, 'test') but I can not read a JSON string (for example, {"Test": "value"}.

if LAST_EVENT_MESSAGE == test  --> OK
if LAST_EVENT_MESSAGE.Test == value --> KO

Could you help me ?

Regards

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7640
  • Karma: 56330
Re: Raise Event Block and Json String - Composer 8.1.4
« Reply #1 on: March 24, 2016, 06:22:43 PM »
Convert the json to string maybe? As the input for the function is a string makes sense a json not be valid.

Offline ymattica

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Raise Event Block and Json String - Composer 8.1.4
« Reply #2 on: March 24, 2016, 06:40:31 PM »
Thanks,
I'll do what I suggest we do even if the JSON format was very convenient for my purposes :(
Best Regards

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7640
  • Karma: 56330
Re: Raise Event Block and Json String - Composer 8.1.4
« Reply #3 on: March 24, 2016, 06:53:34 PM »
Yes, but then on the other side you grab the string and just convert to a json object again

Offline ymattica

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: Raise Event Block and Json String - Composer 8.1.4
« Reply #4 on: March 25, 2016, 09:27:47 AM »
OK  ;)
Thanks again