Functions : Can I pass a value from a page parameter to a function ?
Functions : Can I pass a value from a page parameter to a function ?
I have pageparameters that set "startDate" and "endDate"
example :
https://creatorapp.zoho.eu/MYCOMPANY/MYAPP/#Page:Home_Generic?startDate=01-Jan-2021&endDate=31-Dec-2021
I would like to use a series of functions in panels in that same page - can I read these parameters or pass them to a function ? In the function below I want to replace the use of today.subyear with the values being passed via the url.
float panel_calcs.sum_NowYTD_PreviousYear()
{
sum = carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted);
if(carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted) == null)
{
sum = 0.0;
}
else
{
sum = carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted);
}
return sum.round(2);
}