THE FOLLOWING IS A SCHEDULED BOT WHICH IS SUPPOSE TO GIVE ME ALL THE PATIENTS FOR THE WEEK, BUT ALSO I WANT ALL THE PATIENTS RELATED DAILY STATS
“PATIENTS TABLE” (PARENT TABLE - KEY = [UNIQUE ID], IT ALSO HAS A REF TO THE “STATS” TABLE which = [STATUS DATE HELP]
“STATS” (CHILD TABLE - KEY = [STATS UNIQUE ID]), it has a REF to the PATIENTS TABLE which = [PATIENT ID]
I have not selected “FOR EACH ROW IN TABLE” in Bot because it gives me repetitive emails, I just want one email with the list of patients and their related stats, I am struggling to tie the related stats to the Patient with a scheduled bot.
I am struggling to get all of the related child records (stats) to the parent (patient), if I could use a _THISROW I would have it working, but because its a schedule I cant seem to group them together…
You may want to refer the following sample app to get ideas. You may not get the exact set tabular setup as you have shown but you will get ideas in creating outer > loop with the parent table records. Inside it will be the child table > loop.
Please take a look at the template of the bot “CustomerUpdateRule”
In general, the report templates are a bit tricky to create and you may need some experimentation, taking a look at several posts and tips and tricks section in the community. You may still not get exactly what you are looking for but may come close to your intended format.
Thank you @Suvrutt_Gurjar that was the solution. I have spent hours trial and error changing expressions, then setting the time, save, wait the minute and see if it fires.
But because this is a scheduled automation I don’t see how to incorporate _THISROW as the automation is retrieving from the whole table without a reference row.
For the patients in the last 7 days, please create a slice called say “Patients_LastWeek” in the parent Patients table with a slice filter expression something like
[Date Column in the Patients Table]>= TODAY() -7
Please use this slice in the outer <> expression in place of existing expression, something like
<<ORDERBY(Patients_LastWeek[UNIQUE ID],[Name])>>
For the related records , please try a <> expression something like