REST API JSON File - assigning values to a Java Desktop Application

Hi everyone!

I have a question that is bugging me these days.

So I managed to read a JSON file and extract the data and then fill the field in a Java application with that data.

What I did was

  1. HTTP Request GET call to the API
  • Output - Result: Created a Variable strNameSurname
  1. Deserialized the JSON
  • Input: JSONString: strNameSurname
  • Output: JSONObject: JSONObjectNS
  1. Multiple assign two values : Name, Surname
  • Name = JSONObjectNS.SelectToken(“name”).ToString
  • Surname = JSONObjectNS.SelectToken(“surname”).ToString
  1. In the Java App I used the Selector Type Into:
    First Name: Name (the variable)
    Last Name: Surname (the variable)
    Click Save.

Question:

I have over 100 JSON entities (people with name and surname) and I need to:

  1. Enter the name and surname from one id
  2. Click Save
  3. Go to the next id Person
  4. Click Save

Right now, if I use the “name” SelectToken it actually extracts all of that data.

Can it be made to start with one Id, put the data, click on Save, go to the next Id?

Anyone? :slight_smile:

Hi @Mihajlo_Stojanovski,

you can do an iteration (loop) send a GET request and take the result to assign activity do the entering part

Note: Dynamically changed get request and where you need to add data (Java application)

1 Like

I am sure it is pretty simple for you but can you elaborate a bit more :smiley: with a simple example?

Hi @Mihajlo_Stojanovski,

Post a json out put i’ll create a workflow for you

I am afraid I cannot put out the real JSON file (sensitive data).

But I can give you a sample file.

The difference would be that each person will have an id, and some other information, but basically yeah…it’s a lot of people with a lots of data and I need to separate them, one by one.

inputJson.json (1.3 KB)

If you need an API call

https://jsonplaceholder.typicode.com/users

Here is an example very closely related to mine.