I have been struggling to get the nest repeat region to display the data that i want correctly for several days. Just when i think i have it correct, it just doesn’t display what i want.
Here is a basic structure of my querys
Query 1 - gets patient ID number
Repeat Region 1 - Runs through Query 1 to get the names
Query 2 - Within the repeat region of this i am going and finding out specific dates that this patient was seen through a query
Repeat Region 2 - loops through the Query 2 to show all of the dates
Results should look like this
Patient Name
** Date**
** Date**
** Date**
However, i am not able to get the system to loop through the dates. The patient name shows correctly, but the dates are only showing the very first record date and no others (see screenshot)
From the screenshot you can see that i see the data in the results section (highlighted) but no matter what repeat region i setup on the App side, it doesn’t show this data
Okay, i understand that and was able to get the repeat (query1) and the Query 2 to display
now, i have a repeat (query2) that i need to run which will get an date of a record and display the details.
…query 2 - gets the records for the particular patient from (query1)
…repeat query 2 - will get all of the details of the record ( multiple lines in mysql)
How can i get this to display? I have currently it setup like this
sorry, it is just a little frustrating when something that is a simple coding procedure is taking so much time to get the same results in Wappler for the repeat feature. It is not producing the results that i expect and i am having the hardest time to get this working correctly.
Green Row is the first repeat query getting the patient data
Yellow Row is the query getting the specific dates for that patient that they were seen
LIght Grey is the details of the treatment and what they had done on each specific visit
I hope this helps clear up what i am trying to accomplish and allow you to assist me on what i am doing wrong.
Well, it is actually simple with Wappler, as the tutorial i sent you shows. It's nothing too complicated when you have the right logic and know what you want to do with your data and how do you want to present it on the page.
You are binding a single record inside each of your dates.
You need to repeat the query data about the details per date so you need to create a repeat region on your page from the treatment details query, nested in each date.
so are you saying that for the details of each of the dates, i do not create a repeat region on the server side, but on the page side?
I did follow your tutorial to a T that you sent me…and that worked to get the specific Patient Names and the Dates of treatment that coorespond for them. However, now i need to have an additional nested repeat region under each of the Dates of treatment to get all of the actual treatments for that date.
Do i create the repeat on the server side like i have or just do this on the page side? That is where i am confused.
You need a repeat on the server side only when you need to nest a query inside it.
In your case your query is already nested in a repeat and you don’t need to nest more queries. So use it directly to create a repeat region on the page.
okay, i did what you told me…and the repeat function for the treatment details is showing the same treatment and ID# for each of the dates and patients. So it is not repeating but looks to only be taking the first record in the query.
How can i get the query to loop through a sub-query to get all of the treatments that were applied on the date that is shown in the query?
-Patient Info #1
----Date of Treatment
------Need a query to repeat here based on the ID of the Patient and the Date of the Treatment to get all treatments
-Patient Info #2
—Date of Treatment
------again need query to run again to loop through treatments
And in your server action turn off output for this step: get_treatment_date as you don’t need its data on the front end, you are using the data from the repeat_treatment_date