retrive recored using employee id in rest app in outsystem

Hi, I am new to the Outsystems platform. I am exploring how to display Particular Employee records when you enter a name of that employee, using consume REST API.

I already did Expose my record but I am unable to consume the data. and I am attaching my project oml file in that I am done exposing operation.

Can someone teach me how to do it properly? I've been searching the whole day but can't find what I wanted. Thank you in advance.

pratiksha Dabhade wrote:

Hi, I am new to the Outsystems platform. I am exploring how to display Particular Employee records when you enter a name of that employee, using consume REST API.

I already did Expose my record but I am unable to consume the data. and I am attaching my project oml file in that I am done exposing operation.

Can someone teach me how to do it properly? I've been searching the whole day but can't find what I wanted. Thank you in advance.


I am Exploring how to display particular employee records when you enter the name of that employee through URL, using rest API.

Hi Pratiksha,

Can you please tell what doesn't work? Because at a first glance, the REST service looks ok.

pratiksha Dabhade wrote:

pratiksha Dabhade wrote:

Hi, I am new to the Outsystems platform. I am exploring how to display Particular Employee records when you enter a name of that employee, using consume REST API.

I already did Expose my record but I am unable to consume the data. and I am attaching my project oml file in that I am done exposing operation.

Can someone teach me how to do it properly? I've been searching the whole day but can't find what I wanted. Thank you in advance.


I am Exploring how to display particular employee records when you enter the name of that employee through URL, using rest API.


Hi,


Found post for you I hope that will help you,


https://www.outsystems.com/forums/discussion/40251/mobile-how-to-add-filter-in-api/

https://www.outsystems.com/forums/discussion/48063/how-to-filter-data-in-outsystems-mobile-once-we-get-response-from-rest-api/

Kilian Hekhuis wrote:

Hi Pratiksha,

Can you please tell what doesn't work? Because at a first glance, the REST service looks ok.


Hello Kilian,

Actually I already finish Exposing My data. But I am Unable to Consume my rest API. I also share my oml file with you. in that file, I am trying to consume my service.


Actually my target is to create one rest API, in that when I enter the employee name then I got whole employee information.

The only error that's present is that the Input Parameter of GetEmployee is the employee's name, but you're trying to put the entire record in. The error message also says that: "Invalid Data Type | 'Text' data type required instead of 'Employee'."

Hi Pratiksha,

I see you have managed to create your own EmployeeAPI using the documentation and exercise I shared with you earlier, very good!

So the next step you are trying to accomplish, is retrieving Employee data from that EmployeeAPI and display that data on a screen, is that correct?

As good as OutSystems training department is, they also have detail documentation for this part and of course also an exercise on how to retrieve data from an API and display it on a screen. 

Keep in mind that this exercise is made for Traditional Web, so for Reactive Web you should use a Data Action instead of a Preparation in order to fetch the data from the EmployeeAPI before the screen renders.

Hope this helps!

Regards,

Nordin


EDIT: I see you are in good hands here with Kilian helping you out :)

Kilian Hekhuis wrote:

The only error that's present is that the Input Parameter of GetEmployee is the employee's name, but you're trying to put the entire record in. The error message also says that: "Invalid Data Type | 'Text' data type required instead of 'Employee'."

I modify it.

but got an error in the browser. 

Please check Service Center to see what the actual error is.