Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: JSON Decode
Topic Summary: creates a "structure" upon decode and works great, but ...
Created On: 03/31/2017 10:21 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 03/31/2017 10:21 AM
User is offline View Users Profile Print this message

Author Icon
ScottFinkle
Apprentice (20-49)

Posts: 23
Joined: 11/06/2009

... I'm looping making repeated calls to JSON Decode to the same "structure" and I'm receiving the error:

JSON failed (Error: Variable or function "json_HTTP_Response" already exists)

AutoMate typically handles this sort of thing pretty well in the past which is to say if you performed an operation that created a dataset, you could perform the same operation again creating the same dataset and it would just be overwritten. JSON Decode appears to work differently.

Does anyone know how I "release" a "structure" so I can make repeated JSON Decode requests?
 03/31/2017 02:53 PM
User is offline View Users Profile Print this message

Author Icon
Justin Aucoin
HelpSystems

Posts: 360
Joined: 02/15/2016

Hello Scott,

Per your support ticket, this issue has been verified and assigned a bug number #22386. We hope to correct this issue in an upcoming release of the software. You will be notified when the solution is available via email.

Please let us know if you have any questions or concerns.

Thank you for your help and patience.

-------------------------

Justin Aucoin | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 04/20/2017 06:47 PM
User is offline View Users Profile Print this message

Author Icon
HeehangSeo
Student (5-19 posts)

Posts: 13
Joined: 11/06/2016

In JSON Decode Action, I get an error when I input Json string as follows. 

If the key contains a hyphen, an error appears. 

 

-------------------------------------------------

{

        "B-B": "BBB",

        "A-A": "AAA"

}

 

--------------------------------------------------

[Main](Step 1) JSON failed (Error : Invalid variable name "B-B")

--------------------------------------------------

 04/21/2017 09:47 AM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Heehang,

Please provide the step from Automate that generates the error message. Use the attach code to paste the step.



-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 05/08/2017 01:39 AM
User is offline View Users Profile Print this message

Author Icon
HeehangSeo
Student (5-19 posts)

Posts: 13
Joined: 11/06/2016

I added a notification configuration to the Amazon S3 Bucket.
(Set Notification to AWS SQS when an object is created in a specific bucket.)
And, when BPA task connects to SQS and receives message and decodes it, 
error occurs.

In general, an example of an Amazon Notification message is:
--------------------------------------------------------
{
  "Records": [
    {
      "eventVersion": "2.0",
      "eventSource": "aws:s3",
      "awsRegion": "ap-northeast-2",
      "eventTime": "2017-04-18T06:07:57.321Z",
      "eventName": "ObjectCreated:Put",
      "userIdentity": {
        "principalId": "AWS:AIDAJEQBDECHCBKSOHD32"
      },
      "requestParameters": {
        "sourceIPAddress": "xxx.xxx.xxx.xxx"
      },
      "responseElements": {
        "x-amz-request-id": "6F2D9717DEA880BC",
        "x-amz-id-2": "W+hxP3PShHj2JjAco8ZqgWZFu+Hs8CZKcT0v3CIgZXpMbpx2obu7pElusICqMLpN8T8YEljeJvk="
      },
      "s3": {
        "s3SchemaVersion": "1.0",
        "configurationId": "demo.sqsEvent",
        "bucket": {
          "name": "demobucket",
          "ownerIdentity": {
            "principalId": "A61YNLACFCRNT"
          },
          "arn": "arn:aws:s3:::Demo.xxxxxxxx"
        },
        "object": {
          "key": "get_download+%288%29.zip",
          "size": 201966,
          "eTag": "0fa7a54a53d4e165792e2b01f77819e2",
          "sequencer": "0058F5AD3D49885BB5"
        }
      }
    }
  ]
}
--------------------------------------------------------
if there is no "x-amz-request-id" and "x-amz-id-2" in the list of keys
 in the above Json message, there is no error
It would be very inconvenient if the key string does not contain dash character.



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)





Edited: 05/11/2017 at 09:45 AM by HeehangSeo
 05/19/2017 09:46 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

I apologize for the delay, we are currently investigating this issue. We will update the thread asap.

-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 05/22/2017 08:21 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

Would it be possible to set-up a GoToAssist session where we can take a closer look at this issue? If this is possible please send an email over to AutoMate.Support@helpsystems.com with a list of your availability.

Note: Please reference this forum thread in your email.


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 07/18/2018 11:46 AM
User is offline View Users Profile Print this message

Author Icon
DavidDaniels
n00b (>6 posts)

Posts: 3
Joined: 01/04/2014

Was there any resolution to this? I get json decode error messages quite frequently. Thanks.
 07/18/2018 02:19 PM
User is offline View Users Profile Print this message

Author Icon
Hamid Noorbakhsh
HelpSystems

Posts: 454
Joined: 07/29/2008

David,
The variable names can not have a hyphen. As a workaround till we find a more permanent solution for this, one can replace the hyphen with another character that is allowed but not used frequently.

I by no means am saying this will work in all cases, but it will allow you to get the decode to work and you can access it easier, remembering you changed the hyphen to something else so access variables needed with the replaced character. I just chose an underscore.

Edit - The original issue of 'variable/function already exists' has been addressed previously and fixed in 11.0.1 release.


Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Thank you for choosing AutoMate

Hamid Noorbakhsh | Senior Software Engineer
AutoMate | A Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700

Edited: 07/18/2018 at 02:35 PM by Hamid Noorbakhsh
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 378 guests browsing this forum, which makes a total of 378 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog