<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007RUZGKCA5Okta Identity EngineWorkflowsAnswered2023-08-16T12:15:35.000Z2022-02-10T14:18:38.000Z2022-02-11T12:21:15.000Z

AndyC.64975 (Customer) asked a question.

API Workflow - writing result to table

I'm setting up my first API call in Workflows. This calls our HR system, and will eventually become the source for user provisioning. I have the API working in Workflows but I am stuck on how to write the result to a table.

 

The result returns in XML, so I am parsing to JSON. The JSON contains several fields which I wish to write to a table. I then thought to use 'Pluck' but its seems this can only search one key. How's best to achive this?


  • AndyC.64975 (Customer)

    This is an exmaple of the API result:

     

     {

      "Company": [

       "100"

      ],

      "CompanyEmail": [

       "test@test.com"

      ],

      "CompanyName": [

       "The Test Company"

      ]

    }

    Expand Post
  • TimL.58332 (Workflows)

    Hi Andy,

     

    Based on the example output it looks like you have an object that has 3 keys and each key contains a "list" for a value. You essentially are going to need to deconstruct it. Assuming each list is always one value something like this would do it (at least for your example)

     

    image

    Expand Post
  • AndyC.64975 (Customer)

    Thanks for reply. I'll try your method today and report back.

  • AndyC.64975 (Customer)

    Hi. This isn't working yet. Maybe I need to show you more of my JSON. Here are two people pulled out of the HR system

     

     

     {

      "Company": [

       "100"

      ],

      "CompanyEmail": [

       ""

      ],

      "CompanyName": [

       "The Test Company"

      ],

      "CostCentre": [

       "Sales Team"

      ],

      "CostCentreCode": [

       "SALES"

      ],

      "Department": [

       "Sales Department"

      ],

      "DepartmentCode": [

       "SALES"

      ],

      "EmployeeNumber": [

       "32"

      ],

      "EmploymentEndDate": [

       {

        "$": {

         "i:nil": "true"

        }

       }

      ],

      "EmploymentStartDate": [

       "2022-02-22T00:00:00"

      ],

      "Forename1": [

       "Black"

      ],

      "Forename2": [

       ""

      ],

      "HomeEmail": [

       ""

      ],

      "JobDescription": [

       "Salesperson"

      ],

      "Location": [

       "Townside-Upon-Stour"

      ],

      "LocationCode": [

       "TOWN"

      ],

      "NINumber": [

       "GG223366A"

      ],

      "PersonnelNumber": [

       "32"

      ],

      "PostNumber": [

       "SALES"

      ],

      "Surname": [

       "Williams"

      ],

      "Title": [

       "Ms"

      ]

     },

     {

      "Company": [

       "100"

      ],

      "CompanyEmail": [

       ""

      ],

      "CompanyName": [

       "The Test Company"

      ],

      "CostCentre": [

       "Office and Administration"

      ],

      "CostCentreCode": [

       "OFFICE"

      ],

      "Department": [

       "Sales Department"

      ],

      "DepartmentCode": [

       "SALES"

      ],

      "EmployeeNumber": [

       "35"

      ],

      "EmploymentEndDate": [

       {

        "$": {

         "i:nil": "true"

        }

       }

      ],

      "EmploymentStartDate": [

       "2022-02-22T00:00:00"

      ],

      "Forename1": [

       "White"

      ],

      "Forename2": [

       ""

      ],

      "HomeEmail": [

       ""

      ],

      "JobDescription": [

       "Head of Administration"

      ],

      "Location": [

       "Townside-Upon-Stour"

      ],

      "LocationCode": [

       "TOWN"

      ],

      "NINumber": [

       "GG223344B"

      ],

      "PersonnelNumber": [

       "35"

      ],

      "PostNumber": [

       "ADMINLEAD"

      ],

      "Surname": [

       "Peter"

      ],

      "Title": [

       "Dr"

      ]

     }

     

    I'm using Get Multiple but getting Invalid Input. However when the JSON contains one user, the 'Get' works.

    Expand Post
This question is closed.
Loading
API Workflow - writing result to table