WebService data into entity/database

WebService data into entity/database

Hello all,
I am currently making some tests and what seemed simple turend out not to be.
Through a call to a webservice i am able to get an Item list of some items. I am trying to (after getting that itemlist) just show one of those items, by clicking on it for example. The problem is that it doesnt seem possible to make a query to a Structure, only to Entities, that way i cant get a specific item from that itemlist. The obvious solution would be to implement also a method to retrieve one record only through the webservice, but this is just for testing purposes.
Other solution i tried was to get the item list and "copying" it to a persistent entity, havent had luck with that also.

Can anyone point me in the right direction, or ive opinions on the best way to aproach this issue?

Thanks in advance.
Hi Rui

Welcome to the OutSystems Community, hope we'll see having fun around here for now on! :)

Let me try to explain the the differences between structures and entities and how you can overcome your problem.

Entities are data model definition that represents a database table, and as such, when you update the entity record and save it to the table using CreateENTITY or CreateOrUpdateENTITY your data will be stored in a persistent manner on the database. However, until you do that, it only resides in memory on the applicaiton, for as long as the web request runs.

Structures on the other hand are just in memory datatypes, that will allow you to manipulate the structure data in memory during the web request, but the data will not be stored in the database in a persistent manner.

Since you can execute queries on databases only, you can query entities for the reocrds stored on the database. But not in memory on structures.

If you have a WebService that returns all items in a list, and you wna tot edit one by one, the best wait to take advantage of the Intelliwarp, is to save all intems into an entity, to be stored on teh database, and them just use Intelliwarp by dragging the entity to the wescreen to have a table records to show the items, and edit screens to actually edit the item.

But remember, when you edit the item and save it again, it will be on the database, not thorugh the web service to the external system. For that, you'll need to have another methods that updates that item on the remote system.

By the way, have you done all Tutorials on the Service Studio? I just that.

Hope this helps.


Miguel Simões João
is there a sample in the tutorials for webservices ? 
i got as far as tutorial 7 atm
Hi Stijn,
There is no video on the learning tutorials regarding webservices.

You can take a look in the help documents: