How to display array data in list and data are getting from rest post type api.

How to display array data in list and data are getting from rest post type api.

  

Hello,

I want to display array data in list, and data are getting from post type rest api.

In above screen i have 3 records in array, n i want to display it like this...

When i use list, its showing only first record. Plz help how to display all records in this format.

if it is possible then please share screenshots for explaining .


Thanks ,

Shivani Singhania

Hello Shivan,

Have you seen this documentation on how to consume a rest webservice?

https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/REST/Consume_REST_APIs/Consume_a_REST_API

Than, after executing your rest method, you should get as output a list, that you can process, eventually save to database, or provide as source to a table records or list records in screen.

This is all explained in the online training, that you should do if you didn't yet, or review, if you alread did:

For web: https://www.outsystems.com/learn/paths/2/becoming-a-web-developer/

For mobile: https://www.outsystems.com/learn/paths/1/becoming-a-mobile-developer/

Eduardo Jauch wrote:

Hello Shivan,

Have you seen this documentation on how to consume a rest webservice?

https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/REST/Consume_REST_APIs/Consume_a_REST_API

Than, after executing your rest method, you should get as output a list, that you can process, eventually save to database, or provide as source to a table records or list records in screen.

This is all explained in the online training, that you should do if you didn't yet, or review, if you alread did:

For web: https://www.outsystems.com/learn/paths/2/becoming-a-web-developer/

For mobile: https://www.outsystems.com/learn/paths/1/becoming-a-mobile-developer/

hi Eduardo Jauch,

I consumed a rest webservices, and data are showing in list but my issues is that, only 1 record are showing in list and i want to display all records of list.


Thanks 


Than, show how you are doing things, and we xan point out what you are doing wrong.

Because there are many different ways to show a single record of a list.

For example, are you using a list records table records in the screen to show the list? Are you defining the maximum number of lines on them to 1?

The rule in any programming tech forum is: Show what you did, tell what you get and what were you expecting.

Only this way we can really help. 

Cheers.

Eduardo Jauch

Eduardo Jauch wrote:

Than, show how you are doing things, and we xan point out what you are doing wrong.

Because there are many different ways to show a single record of a list.

For example, are you using a list records table records in the screen to show the list? Are you defining the maximum number of lines on them to 1?

The rule in any programming tech forum is: Show what you did, tell what you get and what were you expecting.

Only this way we can really help. 

Cheers.

Eduardo Jauch

Step 1:-    When User click on Leave Status menu , it should be go on Leave status Screen, n I have used         LeaveStatusOnClick Method on Leave status menu. after that..

Step 2:-   


Step 3:- 


In step 3 i have used list on Tab1, In list source property, i set the value of GetLeaveHistory.List.


after that i published it, it show only one record.


Thanks

Shivani,

In the action you shows, you are doing a SINGLE CreateOrUpdate after deleting all the data.

Doing this, you will store a SINGLE record in the entity.

If you want to store all the records that come from the rest api, you need to:

1. Loop through the list that comes from the rest api and store each record.

2. If your action is bring called to each item, than you can't delete all the records of the entity in this action (this must be done before)

Cheers,

Eduardo Jauch

Eduardo Jauch wrote:

Shivani,

In the action you shows, you are doing a SINGLE CreateOrUpdate after deleting all the data.

Doing this, you will store a SINGLE record in the entity.

If you want to store all the records that come from the rest api, you need to:

1. Loop through the list that comes from the rest api and store each record.

2. If your action is bring called to each item, than you can't delete all the records of the entity in this action (this must be done before)

Cheers,

Eduardo Jauch

Eduardo Jauch


I am new for Outsystems, So i don't know how to use For Each loop.

I have used For Each loop, and i set the values of Record List, Start Index,& Maximum Iteration. But it gives an error is that: For Each must have 2 outgoing connectors in 'LeaveStatusOnClick' Client Action.

I am getting confused to define which 2 outgoing connectore i have to use.


Thanks.


Solution

Shivani,

You REALLY need to do the online training or take a live class.

This link teach hoe to use the for each. It is for web, but is the same thing for mobile.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Implement_Application_Logic/Iterate_a_List

Cheers

Eduardo Jauch

Solution

Hello Shivani,

Was you able to do the foreach?

Cheers

Eduardo Jauch

Eduardo Jauch wrote:

Hello Shivani,

Was you able to do the foreach?

Cheers

Eduardo Jauch

Hi Eduardo Jauch,

Yes, my all issues are resolved

Thank you so much.:-)


Hi Shivani,

Good to hear. :)

Please, mark the correct answer as the final solution, so that others with the same question will find the answer easily.

Cheers,

Eduardo Jauch


Hello Shivani Singhania,

Please mark relevant answer as solution to make this helpful for the community.

Thanks and Regards,
Atul Patel

People,

On Mobile, there's also a CreateOrUpdateAllEntityName for local storage, so you don't need to use a ForEach! Shivani, I would advise you to use that, it makes for simpler logic and is probably a bit faster.

Eduardo, though I agree with you on checking the documentation etc., in this case it's a bit pot and kettle ;).

Kilian Hekhuis wrote:

People,

On Mobile, there's also a CreateOrUpdateAllEntityName for local storage, so you don't need to use a ForEach! Shivani, I would advise you to use that, it makes for simpler logic and is probably a bit faster.

Eduardo, though I agree with you on checking the documentation etc., in this case it's a bit pot and kettle ;).

Hahahaha

Sorry, because I have being doing little mobile lately, I keep forgetting about many of the facilities that there are there that are missing in web (and that I would like to have already). Should have looked into mobile documentation myself xD

My brain is still too "web wired"...

Time to a revision on Mobile :) (And this gives me a nice idea).

Sorry :)

And thanks for pointing this :)

Cheers

Eduardo Jauch


Haha, no problem Eduardo, you're a tremendous help on the forum in general, so slipping up once in a while will be forgiven :)) Happy revising :).

Kilian Hekhuis wrote:

Haha, no problem Eduardo, you're a tremendous help on the forum in general, so slipping up once in a while will be forgiven :)) Happy revising :).

Thanks Kilian,

I'll use this as stimulus and will take the mobile certification. See if I do this before the end of the year.

Cheers

Eduardo Jauch

P.S.

I'll stop chatting here...