Sorry, Riley. I tried editing the last post and it wouldn’t let me because it was there too long, even though the pencil icon was there. Please use this modified reply instead.
ISSUE WITH ALTERNATING ROW NUMBERS:
I tried your suggestion for background-color style and received an error message at run-time: "Missing helper: “mod”.
So I tried using a function for this instead.
function IsEvenRow(rowNum) {
return rowNum % 2 === 0;
}
I’m having trouble calling this. My snippet HTML is:
<div style="background-color: {{#if (IsEvenRow(MemberSeq))}}#EFEFEF{{else}}#FFFFFF{{/if}};">
I’m not sure if I have too many parentheses here. I thought the IF needs parens of its own. Please advise
Unfortunately, it causes the error below:
ISSUE WITH CONVERTING DATE:
I tried your suggestion for using a function. The suggestion above looks backward to me, because I’m trying to change a yyyy-mm-dd date to a m/d/yyyy string. So here is the function I came up with, which doesn’t require specific string positions.
function ConvertDateToUS(dateStr) {
const date = new Date(dateStr); // Convert string to Date object
const month = date.getMonth() + 1; // Months are zero-based
const day = date.getDate(); // Use getDate() (local time)
const year = date.getFullYear();
return `${month}/${day}/${year}`;
}
Could you please advise on the feasibility of using your function, which looks for the dashes, and simply reverse your logic to expect a dash delimiter and output the date with slash delimiters in the right order?
Also, I get an error calling this function. I put the following in the cell for today’s date:
{{ConvertDateToUS(five.now())}}
This does not seem to work. Did you say I first need to capture the date in a variable, then use the variable?
If so, which event should I put this in? I already have code that runs when the user logs in, to capture the UserKey in a variable. I could add this variable assignment to that code also. Then it would be current for the current login session. Even though it’s possible for the user to log in one day then try to run the report the next day, my experience is that a session will not last that long, and if I try to use a session from the prior day it doesn’t work. So is this a good idea to just assign the variable at login time? Then would I call it with “five.variable.CurrentDateTime”?
LATEST FDF IS ON ONEDRIVE