How to display the REST API response in Editable Table ?

Hi,


Is there any way to display the REST API response in Editable table and after edit, save these details in Outsystems entity.


Thanks,

Suraj

Hi Suraj Hukkire,

Yes, you would need to create a local variable with the list record type you want, call REST API on Preparation stage, copy its response to your variable and use it as a source for your Editable Table.

Also you would need to implement all the logic for Add, Update and Delete records for Editable Table.

And of course you can save it using Create or CreateOrUpdate actions on an Entity.

Vitaly Martynenko wrote:

Hi Suraj Hukkire,

Yes, you would need to create a local variable with the list record type you want, call REST API on Preparation stage, copy its response to your variable and use it as a source for your Editable Table.

Also you would need to implement all the logic for Add, Update and Delete records for Editable Table.

And of course you can save it using Create or CreateOrUpdate actions on an Entity.

Thanks Vitaly for your quick response.

I am working on your given solution. If anything will let you know.



Suraj Hukkire wrote:

I am working on your given solution. If anything will let you know.

Sure. I'll be glad to help you in your journey :)

Hi Vitaly,

I have refereed your given way, created local variable  and assigned the list type. Then to fill the editable table  executed REST API on 'Validate & add' button action as below,


The 'ValidateAdd' screen action as below,


Assigned To local list type variable 'SerialNumberDetails''


After assigned, used ajax refresh for the Editable table wrapper and  cell variables of Editable table.

Now REST API response not reflected yet on Editable table.

Is anything missing in above steps ?


Thanks,

Suraj 

Solution

Suraj,

You should probably use ListAppend action instead of just assigned something to SerialNumberDetails.Current.

I've attached an example of the same approach to this post, it simulates a call to REST API by invoking CallRest server action and appending its results to a record list.

Hope that helps!

Solution

Vitaly Martynenko wrote:

Suraj,

You should probably use ListAppend action instead of just assigned something to SerialNumberDetails.Current.

I've attached an example of the same approach to this post, it simulates a call to REST API by invoking CallRest server action and appending its results to a record list.

Hope that helps!

Thanks Vitaly !!! Resolved the Issue.

I am working on further activities on same task. will let you know if anything challenging.