Creating a Rest API to import Data inside a Table
Application Type
Reactive
Platform Version
11.14.0 (Build 33133)

Hi Everyone, 

I am Working on a Table  which needs data to be imported using a rest API. i have tried using some videos to refer and created a sample Rest API  but the  data is not getiing imported. I think primary issue is related to the path structure.. I am posting .oml  of the work of my Rest API - Kindly suggest what i can do to acheive  import of the data to my Table

RestExpose.oml

Hello saif sheikh,

After adding some data to your oml  I consumed the API and was able to retrieve information. 

Are you have trouble consuming the API or exposing it? 

Kind regards, 

Paulo Rosário





Hi Paulo, i think since my Rest API was not exposing the data , i am facing issues with both exposing and consuming API.. Could you please Share the changes you have made  to the oml file so that i could figure out the errors in the oml file..

Thank you for taking time to answer my queries..

I made some changes to your oml and added some actions. One to expose the API and one that consumes the API.

Hope it helps! 

Paulo Rosário

RestExposeConsume.oml

Hi Paulo, i tried using the oml file you have sent, using postman i tried to get the link through the documentation  to display my API but it shows error. Baes on the error, i made changes to table id data type and changed it to Long integer but its not working. 

file.png

Hello Saif,

Here is a screenshot of the postman call 

You should pass the id of the table you what to get ( 1,2,3..567..etc ).

The oml I shared with you should have all the steps you need to consume and expose your API. 

Best regards,

Hi Paulo, received the data in the API following your instructions... could  you help me out display it on my table file. Referring to the screenshots shent by Marcio down below . stuck here.. 

g.png

Solution

Did you try to debug and see where you are getting your error? I don't know which is the method you are talking about but I saw that the EditTableName I think it has some errors, the  GetTableById is okay. Did you check if your entity/table has data?

What video did you see? It was this one? https://www.youtube.com/watch?v=Hd1p3kTVpP4

I would need to see what you are passing here

Because when you use the aggregate at the beginning you are replacing everything with the input parameter which makes the aggregate not relevant...

From the video that I shared you trying to give it a name but you are giving everything from the entity. Let me know if I am wrong...

And for that you will need to do this.

Add this attribute

Change this to text

And change the assignment to. Assign the name of the table to a the new table name(input parameter)

And add the aggregate data that was searched before

Let me know if that helps or if I am saying gibberish :D

And please I advise everyone to follow the proper training and I will advise you too in case you didn't do it.

Look at the many courses that OutSystems provides and every course is organized and has a path to follow.

https://www.outsystems.com/training/courses/

This one was the first that I did

https://www.outsystems.com/training/courses/114/developing-web-apps-outsystems-11/

Kind Regards,

Márcio

RestExpose.oml

Hi Marcio,

Yes this is the video I saw to implement the Rest API but our outputs didn't match... I tried to make the suggested changes you have mentioned but I am unable to .. could you please confirm what I can do?

Hi Marcio.. working on the .oml file you have sent.. its asking me to manage dependencies.. could you please confirm the dependencies i should process ?

file 2.png

Working on this .oml file. Followed your instructions with reference to your screenshots.. but i think i got stuck here below.. Have uploaded the updated oml files aswell. 

RestExposeConsume (1).oml

Hello saif sheikh,

After adding some data to your oml  I consumed the API and was able to retrieve information. 

Are you have trouble consuming the API or exposing it? 

Kind regards, 

Paulo Rosário





Hi Paulo, i think since my Rest API was not exposing the data , i am facing issues with both exposing and consuming API.. Could you please Share the changes you have made  to the oml file so that i could figure out the errors in the oml file..

Thank you for taking time to answer my queries..

I made some changes to your oml and added some actions. One to expose the API and one that consumes the API.

Hope it helps! 

Paulo Rosário

RestExposeConsume.oml

Hi Paulo, i tried using the oml file you have sent, using postman i tried to get the link through the documentation  to display my API but it shows error. Baes on the error, i made changes to table id data type and changed it to Long integer but its not working. 

file.png

Hello Saif,

Here is a screenshot of the postman call 

You should pass the id of the table you what to get ( 1,2,3..567..etc ).

The oml I shared with you should have all the steps you need to consume and expose your API. 

Best regards,

Hi Paulo, received the data in the API following your instructions... could  you help me out display it on my table file. Referring to the screenshots shent by Marcio down below . stuck here.. 

g.png

Solution

Did you try to debug and see where you are getting your error? I don't know which is the method you are talking about but I saw that the EditTableName I think it has some errors, the  GetTableById is okay. Did you check if your entity/table has data?

What video did you see? It was this one? https://www.youtube.com/watch?v=Hd1p3kTVpP4

I would need to see what you are passing here

Because when you use the aggregate at the beginning you are replacing everything with the input parameter which makes the aggregate not relevant...

From the video that I shared you trying to give it a name but you are giving everything from the entity. Let me know if I am wrong...

And for that you will need to do this.

Add this attribute

Change this to text

And change the assignment to. Assign the name of the table to a the new table name(input parameter)

And add the aggregate data that was searched before

Let me know if that helps or if I am saying gibberish :D

And please I advise everyone to follow the proper training and I will advise you too in case you didn't do it.

Look at the many courses that OutSystems provides and every course is organized and has a path to follow.

https://www.outsystems.com/training/courses/

This one was the first that I did

https://www.outsystems.com/training/courses/114/developing-web-apps-outsystems-11/

Kind Regards,

Márcio

RestExpose.oml

Hi Marcio,

Yes this is the video I saw to implement the Rest API but our outputs didn't match... I tried to make the suggested changes you have mentioned but I am unable to .. could you please confirm what I can do?

Hi Marcio.. working on the .oml file you have sent.. its asking me to manage dependencies.. could you please confirm the dependencies i should process ?

file 2.png

Working on this .oml file. Followed your instructions with reference to your screenshots.. but i think i got stuck here below.. Have uploaded the updated oml files aswell. 

RestExposeConsume (1).oml


Tried a different method to import data, some path issue again. Trying to expose the data and display it into the claim summary page .. Uploading both the files with reference to project..

RestexposeDemo for rest APi progress

ClaimSummaryPage for UI progress

RestExposeDemo.oml

part 2 - .oml file of the claim summary page 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.