简体   繁体   中英

Cannot convert list in Excel Power Query Editor

I am trying to convert JSON API response into a table in Excel using the Power Query functionality. I am currently getting the error below when I try to put the customerOrderHistory which is a list into a delimited list as I don't want to create extra rows for a list if I can avoid it.

在此处输入图片说明

If possible I would like to either

  • Just print the customerOrderHistory list in the JSON format that it is in already into the cell OR
  • Create a delimited list of the values as the lists only contain one entry at the moment

The JSON test file looks like this:

{
    "computerid": "1",
    "total": 1,
    "results": [
        {
            "computerid": "1",
            "customerOrderHistory": [
                {
                    "orderId": "1",
                    "channelId": null,
                    "agentId": null,
                    "orderItems": 1
                }
            ]
        }
    ]
}

Thanks

You can use Json.FromValue to convert the list into a Binary value, and then use Text.FromBinary to get back the string representation. If you can dig down deep enough to get to the customerOrderHistory field it would look like Text.FromBinary(Json.FromValue(result[customerOrderHistory])) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM