Skip to content

Problem extracting nested jsonData? #9

Description

@cristoslc

I'm passing a script a parameter that looks like this (shown if you use Get ( ScriptParameter )):

{ "jsonData":{ "idMarkingPeriod":"2014-2015","idRoster":10310,"idSection":"409-1 2014-2015","idStudent":"S0000184","comment":"This is a comment.","created":9/24/2015 4:16:27 PM,"effort":100,"exam":85,"mark":87,"modified":9/24/2015 5:16:27 PM } }

When I try to run jsonGet ( Get ( ScriptParameter ) ; "jsonData" ), the result is a question mark ("?").

The contents of $json.error are:

Expected "," instead of "/" [ch:/] [at:159] [context:created":9/24/2015 4]

Here's the calculation used to created the script parameter:

Let (
[   ~idRoster =  "10300"
;   ~idStudent = "100"
;   ~idSection = "410-M"
]
;   jsonO 
    (   jsonOp ( "idMarkingPeriod" ; "2014-2015") 
    &   jsonOp ( "idRoster" ; ~idRoster )  
    &   jsonOp ( "idSection" ; ~idSection )  
    &   jsonOp ( "idStudent" ; ~idStudent )  
    &   jsonOp ( "comment" ; "This is a comment.") 
    &   jsonOp ( "created" ; Quote ( Get ( CurrentTimestamp ) - 3600 ) )
    &   jsonOp ( "effort" ; "100")
    &   jsonOp ( "exam" ; "85") 
    &   jsonOp ( "mark" ; "87") 
    &   jsonOp ( "modified" ; Quote ( Get ( CurrentTimestamp ) ) )
    )
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions