0

I need to be able to query values from a Cosmos DB table and display those values to a JSON file. Is this possible?

//Cosmos Table
{
"id": "usagecounters.mt",
"Logs": null,
"QnAMaker": 228,
"QnAMakerFixYes": 86,
"QnAMakerFixNo": 4,
"HolidayMenuCalls": 10,
"HolidayMenuFixYes": 18,
"HolidayMenuFixNo": 1,
"DCOpsMenuCalls": 19,
"DCOpsMenuFixYes": 15,
"DCOpsMenuFixNo": 0
}

//JSON File
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
   {
  "type": "TextBlock",
  "text": "[QnA Maker Value]", //Value from Cosmos DB
  "weight": "bolder",
  "size": "medium"
},

I need to be able to query values from a Cosmos DB table and display those values to a JSON file.

1 Answers1

1

Those 2 are two different things, you can just use where clause to query the data

 SELECT d.QnAMaker
    FROM doc d
    WHERE d.id = "usagecounters.mt"

and you could write the whole object to JSON file

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396