json - Extract data from coinmarketcap api http get response with power automate cloud flow - Stack Overflow

The api returns data in a json object but it has an unusual structure. For example if returning bitcoin

The api returns data in a json object but it has an unusual structure. For example if returning bitcoin data I get this:

        "data": {
            "1": {
                "id": 1,
                "name": "Bitcoin",
                "symbol": "BTC",
                "slug": "bitcoin",
etc...

and I get this for ethereum:

        "data": {
            "1027": {
                "id": 1027,
                "name": "Ethereum",
                "symbol": "ETH",
                "slug": "ethereum",
etc...

When I use Parse JSON action with the bitcoin sample data it returns this schema:

        "data": {
            "type": "object",
            "properties": {
                "1": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "integer"
                        },
                        "name": {
                            "type": "string"
                        },
                        "symbol": {
                            "type": "string"
                        },
                        "slug": {
                            "type": "string"
                        },
etc...

That works fine for bitcoin but will not work for ethereum due to the "1" in the schema, which would have to be "1027". Is there any way to get rid of the "1" or make it dynamic with a variable?

I have tried to use a variable for the UCID (universal coin ID) but power automate throws errors. I found a video on youtube where somebody did exactly what I am trying to do but he misses out some steps which I could not get to work. Here is the video: text

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745607133a4635734.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信