32
Views
4
Comments
API information extraction to entities
Question

I need to extract information in a consumed API and store in the database entities

2023-12-11 08-54-13
Neha Agrawal
Champion

@Richard Sandaramu 

  1.  Consume the API 

  2. Create a Server Action

  3. Call the API Method in the server action.

  4. Access the Response Data

  5. Map API Data to Entity Attributes

  6. Create or Update Entity Records

  7. Trigger the Server Action created in point #2 :

    • From a Screen: Add a button or link on a screen that, when clicked, calls the Server Action.

    • Using a Timer: Configure a Timer to automatically run the Server Action at scheduled intervals.

2019-01-07 16-04-16
Siya
 
MVP

@Richard Sandaramu : I understand that you need to extract information from an API response, which you’ll be calling from OutSystems, and store that data in a database. This is definitely possible.

To assist you further, could you please provide more details about the API you're calling and the specific information you want to extract and store? If you have an OML file, please share that as well.

2023-12-26 10-35-28
OutSystems Neo
Staff
Sure, you can retrieve data from an API and store it in an OutSystems database entities by following these steps:

1. Start by consuming the API in your OutSystems application by going to the "LOGIC" tab and then to "Integrations" -> "Consume SOAP Web Service" or "Consume REST API" depending on the type of API you're working with.

2. After the API is consumed, create a server action to retrieve the data from the API. Use the methods generated from the API consumption in the server action.

3. After obtaining the data, use an Entity action (Create or CreateOrUpdate) to save the data to a database entity. You would need to do a mapping between the structures returned by the API and your OutSystems entities.

4. After creating the server action, you can call it at any necessary point in your app.

Please note that error handling should also be implemented to handle any problems that might occur during API consumption or data storing.
2024-10-12 12-11-20
Kerollos Adel
Champion

hallo @Richard Sandaramu  , 

After consuming the API, you just need to create a loop if the response is a list, or create a record directly if it's a single item. Here's an example using a free API and saving the returned data into the database. 


https://personal-oqbcw6a2.outsystemscloud.com/APIinformationextractiontoentities/Screen1?_ts=638830347395507307


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