cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Basle
New Member

Get Items from JSON as String

Hello. 

I have an HTTP request with the output:

{
  "values": [
    {
      "worklogId": 10000,
      "updatedTime": 1559035866977,
      "properties": []
    },
    {
      "worklogId": 10001,
      "updatedTime": 1559049406316,
      "properties": []
    },
    {
      "worklogId": 10002,
      "updatedTime": 1559050837039,
      "properties": []
    },
    {
      "worklogId": 10003,
      "updatedTime": 1559589921582,
      "properties": []
    }
  ],
  "since": 0,
  "until": 1559589921582,
  "self": "https://...",
  "lastPage": true
}

I need the worklogIds in this form: 10000,10001,10002,10003 for another request in the same Flow.

Is there a workaround for that?

 

Sorry for the Label, but I could not take any other.

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Get Items from JSON as String

Hi @Basle 

 

For that what you can do is, make the sdsa variable as an array (currently it is string) and in the apply to each delete the set variable action and add append to array varaible action and put the log id from dynamic selector over there. 

 

Next come out of the loop and create another variable of type string and in this use the expression editor and type join and select the array and put a ',' as a delimiter 

join(variables('sdsa'),',')

This will give you all the log ids separated by commas. Does this answer your query?

View solution in original post

4 REPLIES 4
Dual Super User
Dual Super User

Re: Get Items from JSON as String

Hi @Basle 

 

Yes! You can use the parse json action to achieve this. You can get individual items of the worklogId and append those to a string. 

 

I created a reference flow and here is the screenshot of the same:

 

vgh.png

Json Scehma:

{
    "type": "object",
    "properties": {
        "values": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "worklogId": {
                        "type": "integer"
                    },
                    "updatedTime": {
                        "type": "integer"
                    },
                    "properties": {
                        "type": "array"
                    }
                }
            }
        }
    }
}

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Basle
New Member

Re: Get Items from JSON as String

Thanks for your fast reply.

This solution partially answers my question.

For Example , which is the next step to  create a file in onedrive or create a variable wich the output: 10000,10001,100002,10003

 

When i create a file .txt with variable sdsa the text is "100003"

 

Dual Super User
Dual Super User

Re: Get Items from JSON as String

Hi @Basle 

 

For that what you can do is, make the sdsa variable as an array (currently it is string) and in the apply to each delete the set variable action and add append to array varaible action and put the log id from dynamic selector over there. 

 

Next come out of the loop and create another variable of type string and in this use the expression editor and type join and select the array and put a ',' as a delimiter 

join(variables('sdsa'),',')

This will give you all the log ids separated by commas. Does this answer your query?

View solution in original post

Basle
New Member

Re: Get Items from JSON as String

join(variables('sdsa'),',')

thats what i need.

thanks a lot!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,435)