最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin7PV0评论

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

Post a comment

comment list (0)

  1. No comments so far