按值排序 json 然后提取第一个值

sorting json by value and then extract the first value

我从逻辑应用程序中的 HTTP 操作收到这样的响应正文:

[
  {
    "refreshId": "08702296-a2ad-43c5-8729-71dc7af27361",
    "startTime": "2019-02-28T14:53:34.9",
    "endTime": "2019-02-28T15:03:52.62",
    "status": "failed"
  },
  {
    "refreshId": "30484b8a-1934-4ffa-9377-ac9e558614fe",
    "startTime": "2019-02-08T20:20:51.2",
    "endTime": "2019-02-08T20:20:51.9",
    "status": "failed"
  },
  {
    "refreshId": "34b23346-9b6c-4d94-bf77-adc129babaa1",
    "startTime": "2019-02-17T05:37:48.067",
    "endTime": "2019-02-18T07:11:44.167",
    "status": "failed"
  },
  {
    "refreshId": "4a9b715c-e4df-4beb-b1f4-ef696e0c23bb",
    "startTime": "2019-03-05T16:05:22.97",
    "endTime": "2019-03-05T16:28:15.01",
    "status": "failed"
  }

]

我想在 starttime 上对这个正文进行排序,然后提取第一个 refreshId 的正文。我可以在 Logic 应用程序中完成吗?

您可以使用 Select 操作将所有 startTime 值输出为 ticks:[=18= 的数组]

然后使用 Filter 操作查找具有最小或最大(取决于您的意思 "first one")刻度值的记录:

从那里,您可以使用 body('Filter_array')[0].refreshId 来提取您要查找的数据。