Skip to main content
March 6, 2022

RESTAPI from HCM Cloud

  • March 6, 2022
  • 3 replies
  • 0 views

Hi - I have created a routine in Connector Rule to fetch the Worker data from HCM and I was able to assign it to a variables and able to print it successfully.

 

My question is below 

 

1. How I can assign the variables to the List because I am trying to use this connector rule in Data Source and trying to bring the data to the OS stage Area ? is it possible, My function return type is task for the RESTAPI call.

 

2. Or I can create a Extender Rule and create a Table in the Backend and import into the table and create an another connector rule to bring it to the stage.

 

Any suggestion would be appreciated.

 

Thanks

Krishna

3 replies

March 7, 2022

Hi Krishna,

You would typically parse the results from the API into a DataTable and then use api.Parser.ProcessDataTable to populate Stage.

You will need to use different approaches to populate the DataTable depending on the format of the data e.g. for JSON use the Newtonsoft framework.

 

Lee

KrishnaAuthor
March 7, 2022

Thanks Lee. I am using NewtonSoft Framework let me try this approach and update the results.

 

Krishna

March 7, 2022

Also check this post. There is an example in that post.

https://community.onestreamsoftware.com/t5/Rules/REST-API-USE/m-p/3761#M158

KrishnaAuthor
March 7, 2022

Thanks Sai. Let me go through the BR and update you.

 

Krishna

March 7, 2022

I did ask around how to use the ClientFilterRequest method in the connector. However, there is nothing in the documentation around it or how to pass that to the connector rule. Maybe this is not exposed in the UI.

Long story short, I don't think you can pass a parameter or filter to the connector rule (even though a method is there).

 

KrishnaAuthor
March 7, 2022

ClientFilterRequest  - Are you referring to pass query parameters to the API ? 

 

Thanks

March 7, 2022

Yup, that is part of ConnectorArgs. However, there is no way to pass it though. It is there but can't use (or I'm not sure how to use it)