Parse JSON array to Azure Table Storage

Jakob Rognlien 1 Reputation point
2020-06-25T07:10:48.797+00:00

Good morning,

I am trying to export a list from Sharepoint to Azure Table Storage by using JSON array.
It looks like the array contains several object, each object having parameters such ass "name", "address" etc.

The store-to-azure-table function in Logic App seems to expect receiving an object, not an array.
How do we extract each object from the JSON array?

Best regards,
Jakob

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
156 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Ubezzi 2,776 Reputation points
    2020-06-26T00:47:12.29+00:00

    Hi @Jakob Rognlien - You would need to deflate the json and create columns. Please see the following Stack Overflow post: Storing JSON data as columns in Azure table storage

    This is achieved through JSON.stringify(someContext) and then map the functions to columns through an Azure Logic App example:

    module.exports = function (context, someContext) {  
       context.log('Message received: ' + JSON.stringify(someContext));  
       var deviceData = {  
       "partitionKey": moment.utc().format('YYYYMMDD'),  
          "rowKey": moment.utc().format('hhmmss') + process.hrtime()[1] + '',  
       };  
       Object.keys(someContext).forEach(function(key) {  
         deviceData[key] = someContext[key];  
       });  
       context.bindings.deviceData = deviceData;  
       context.done();  
    };  
    

    I hope this helps.

    Regards,
    Mike

    0 comments No comments