locked
Azure tables unable to store flattened JSON RRS feed

  • Question

  • I am using the npm flat package, and arrays/objects are flattened, but object/array keys are surrounded by ' ' , like in 'task_status.0.data' using the object below.

    These specific fields do not get stored into AzureTables - other fields go through, but these are silently ignored. How would I fix this?

    var obj1 = {
        "studentId": "abc",
        "task_status": [
                {
                    "status":"Current",
                    "date":516760078
                },
                {
                    "status":"Late",
                    "date":1516414446
                }
            ],
        "student_plan": "n"
     }

    Wednesday, January 24, 2018 8:49 AM

All replies

  • Try to split into multiple properties of a table entity. Refer to the below doc for some example
    https://blogs.msdn.microsoft.com/windowsazurestorage/2010/11/06/how-to-get-most-out-of-windows-azure-tables/ and let me know the outcome

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

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Wednesday, January 24, 2018 3:24 PM
  • What do you mean?

    Splitting into multiple properties of an entity is exactly what I AM doing...that is what is CAUSING the problem.

    I do not see any relevant example in the article you mentioned. Note that I am using NodeJS (and the 'flat' npm package as mentioned) - the issue seems to be specific to how JSON objects are accepted by azuretables.

    Could you please provide a more specific answer? Thanks!

    Wednesday, January 24, 2018 5:07 PM
  • Could you use a custom delimiter to flatten for your objects .

    For example:

    newObj1 = flatten(obj1, {delimiter: '__'});

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

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Tuesday, February 13, 2018 6:55 PM