How to get data in excel format from post API?

how to get data in excel format from post API
i have api link and parameters how get data i will share link and parameters. you will share sequence file.
link: https://hro.srijo.com/mis109scripts/AsbIViewRest.dll/datasnap/rest/TASBIViewREST/getiview
param:
{
“_parameters”: [
{
“getiview”: {
“name”: “api”,
“axpapp”: “mis”,
“username”: “user”,
“password”: “2ddb40d42bdb”,
“pageno”: 1,
“pagesize”: 100,
“sqlpagination”: true,
“params”: {

            }
        }
    }
]

}

kindly share the work flow…

@domsmgtmeet22,

Just share your API Response JSO and what you are expecting as a sample excel file.

Thanks,
Ashok :slight_smile:

how use this post api in UiPath kindly just share the format

Hi @domsmgtmeet22

Below video should help you.

Regards

Hi @domsmgtmeet22 ,

Here are the exact steps you need to take to retrieve data from the POST API and save it in an Excel file using UiPath:

  1. Create a New Sequence:
  • Open UiPath Studio and create a new Sequence.
  1. Add Variables:
  • Create the following variables:
    • jsonBody (String)
    • responseContent (String)
    • jsonResponse (JObject)
    • dataTable (DataTable)
  1. Build Data Table:
  • Add a “Build Data Table” activity to create a DataTable with the necessary columns. Name it dataTable.
  1. Assign JSON Body:
  • Add an “Assign” activity to set the jsonBody variable with the JSON parameters:
{
  "_parameters": [
    {
      "getiview": {
        "name": "api",
        "axpapp": "mis",
        "username": "user",
        "password": "2ddb40d42bdb",
        "pageno": 1,
        "pagesize": 100,
        "sqlpagination": true,
        "params": {}
      }
    }
  ]
}
  1. HTTP Request:
  • Add an “HTTP Request” activity:
    • EndPoint: https://hro.srijo.com/mis109scripts/AsbIViewRest.dll/datasnap/rest/TASBIViewREST/getiview 2
    • Method: POST
    • Body: jsonBody
    • Response: responseContent
  1. Deserialize JSON:
  • Add a “Deserialize JSON” activity:
    • Input: responseContent
    • Output: jsonResponse
  1. For Each Loop:
  • Add a “For Each” activity to iterate through the JSON array. Assume the array is in jsonResponse("result") (adjust based on actual response structure):

UiPath

Copy code

For Each item In jsonResponse("result").AsEnumerable
  1. Add Data Row:
  • Inside the loop, add an “Add Data Row” activity:
    • ArrayRow: {item("field1").ToString, item("field2").ToString, ...} (adjust based on actual response fields)
    • DataTable: dataTable
  1. Write Range:
  • Add a “Write Range” activity to write the DataTable to an Excel file:
    • DataTable: dataTable
    • SheetName: "Sheet1"
    • WorkbookPath: "path\to\your\output.xlsx"

Regards
Sandy