How to call Data from Data service using Basic Authentication in Postman API

Hello, I’m dealing with a problem in extracting the data from the data service. when I try to get it through API with basic auth it does not allow me to get a login to orchestrator so my Question is how can I connect or get the authentication for data service by using basic auth method ??

  1. How can I convert the data of the generic list to the data table that we get after processing the query entity record. so we can write it in an excel file ??

Hi @rahul.kumar Welcome to UiPath Community
Kindly refer to this thread, it may help you.

Thanks, Gokul for your response but I already see this video but in this, he is calling the data by Oauth2.0 which is based on tokenization and token is a time boundation of 1 hr in this I want to do it by basic auth, please tell if any solution regarding that.

Please refer to the documentation.

The first paragraph of this page states what access type need to be used:

Also to note:

Data Service and Orchestrator are not the same. They are two different components of UiPath Infrastructure, but are accessible via the Automation Cloud when you login using your credentials.

That does not mean that any external client or application can login to Orchestrator or access Data Service by using basic authentication.

Hello, @AndyMenon thanks for your valuable response to my query I come to know that there is no way to call the API through the basic auth method.

Also, can you please help me to find the solution for the below-asked question:

  1. How to convert the system.collection.generic.Ilist to the data table dynamically to get the data from the data service by using Query entity record activity in the studio.

Thanks,
Rahul Kumar

When you use Query Entity activity you must set the output List to be of type IList

Example: If the Entity is Order, then the output to set must be IList. Your environment knows the Order object because you have access to the Entities in your DS instance from Studio.

Once you retrieve that List of Entities, then you can use the For Each iterator to read each order object and add it to a pre-defined Data Table. The Pseudo code for this looks something like this:

For Each order in IList
Add Row to DataTable Activity
{order.number, order.date, order.amount,…}

End

I hope this helps.

1 Like

Thank you for the solution @AndyMenon

can we make it dynamic because this is a static way to call the data can we make it like by changing in its config file we call the Data of entity by query entity records as per our requirements?

And if possible to get the data in excel dynamically can you please provide the . Xaml file for the same.

I will be very grateful if you help with this.

Thank You
Rahul Kumar

There is no hard and fast rule to use the Data Service activities in Studio. If you want the queries to be dynamic, then I would suggest you go the way of the API from Studio because they aren’t tied down to a specific data type such as IList.

As you will receive all information as JSON, you can have a consistent method to retrieve the data from the API response. This can work as a standard pattern as long as you don’t have multi-level entities.

You can checkout this video that shows how to use APIs to query DS Entities. You can build a pattern out of this approach to query any entity you want as per your requirements.

1 Like

Thank You so much I’ll try this method.

1 Like

Great. Good luck with your project! Please do share your findings with the community.

Cheers!

1 Like