Hi Everyone,
I am working on Api integration in my application. my API contains data fields example Ticket id, Ticket description, Ticket Status, Ticket ID and User ID
I need to map my api fields in my Outsystems application such that i am able to change the user id of my data coming from the api. thereby implementing data manipulation of users using Oustsystems application
Please note that the api data is coming through aws and i need to do the user management of my tickets and the status allocation using Oustsystems and then uploading the resultant data back to aws .
Attaching a sample of data for better understanding
Hi @saif sheikh,
What you can do is you can have an excel download of the data that is coming from API.
After downloading it update the data as per your need then upload that excel file and update the data by using API PATCH method.
hope that will help.
Hi Rohan, Could you elaborate on the patch method you are suggesting
Hi saif sheikh,
please visit this link , here describe that how to consume API and Show data in screen as you mention in Image.
https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs/Consume_one_or_more_REST_API_methods
I'm also attach an oml file .If you want please check it also
Thanks
Hi Kundan, i am able to consume the api but facing issues with manipulation of data. since the user management is done inside outsystems while the other fields are coming from the aws.
I have a data action which can show the data coming from aws on the screen but i want to map that data with the user management which is modelled and created on outsystems.
Hi Saif,
I do not know what you mean by "map my api fields in my Outsystems application such that i am able to change the user id of my data coming from the api". If AWS provides a user Id, what kind of user Id is it? Is it specific to AWS, or is it actually an OutSystems User entity identifier?
Hi Killian,
Please note that the fields in brown are the attributes which are received from the api.
The get api shows the data claim id - 100, drg - 689, User id -1, Status 1
the user management which is shown in the 1st table is the requirment. For that we have system entity 'user' and static entity 'status'. marked in green and red while teh claim id and drg code to be used from the api outputso need to combine some of the fields received from api and combine them with entities of outsystems and display them and change them using assign button
The easiest (and least performant) is to For Each over the list returned from the API, and for each record query the User entity and the status entity to find the matching records, and store those along with the API data. Of course, this means one or two queries for each record, so depending on the amount of records this can be pretty slow. Another option, if you're just concerned with showing the right user/status on screen is to limit the queries to the records shown on screen, by using a Block that has the Ids as input, and perform the query inside the Block.
To speed things up, you could create an action/function that looks up the Ids, but set the caching to a few minutes. That will circumvent the execution of the queries in case the same Id is passed. You could use that with either solution described above.
A last solution could be to locally cache the API data in a temporary entity (the entity itself won't be temporary, but the content will), and use a normal aggregate to join the API data with the local entities. This however will give a performance hit initially, when storing the data, and you must be careful to not mix data when multiple users are using the screen at the same time.
What will be the best solution for your use case I cannot say, as I don't know the size of the API data returned, the speed of your connection and database, etc.