14
Views
5
Comments
Unable to execute for each loop
Question

Hi Team,

I'm creating a mobile application. I'm trying to iterate over a list of bookings using for each loop. However, When I'm trying to do it so, it is showing me the below details. 

Can anyone let me know why it is not entering into for each loop and directly jumping on end.


Thanks & Regards

Sahil

mvp_badge
MVP
Rank: #134

Hello Sahil, that's correct and it happens because the List that you are iterating is empty as you can see in the Debugger Section. Can you check why is empty?

BR,

Luis

mvp_badge
MVP
Rank: #91

Hi Sahil,

As per the shared debugger section observation screen clip, It clearly states that the List which you are trying to iterate with is Empty (The Aggregate GetBookingDetails is returning empty Result Set)

i.e. GetBookingDetails.Count = 0 and the CurrentRowNumber = -1

Before iterating the GetBookingDetails.List, check whether the GetBookingDetails aggregate got executed or not by placing the IF node before the ForEach node with the below mentioned condition 


GetBookingDetails.IsDataFeteched = True and GetBookingDetails.HasFetchError = False


IsDataFeteched and HasFetchError is the Data Source (Boolean type) runtime properties, which you can refer in order to get to know the actual status of the Data source.


Regards,

Benjith Sam

Rank: #650

Hi Sahil,

As per your snapshot "GetBooking.List" is empty that why your for each is not iterating the values, I suggest to check the list first and the condition applied into the list.

Hope this will help you

Regards,

Vipasha

Rank: #3392

Thank you everyone for replying. I'm not getting why it is showing the list in empty. It has data but still it is showing the list empty. 

You can check the oml too. I'm attaching it.

Regards

Sahil

SpaTime.oml