- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 02:20 AM
Hello,
After searching for suggestions on the community I ended up with the following Script and Include:
Client Script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 09:19 AM
Replace the lines "var dob =" & 2nd "ga.addParam(" with below lines. it should be sysparm_<anyName> and not sysparam_<anyName>. Now check what are you getting.
var dob = this.getParameter('sysparm_id');//param from client script
ga.addParam('sysparm_id',newValue);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 09:19 AM
Replace the lines "var dob =" & 2nd "ga.addParam(" with below lines. it should be sysparm_<anyName> and not sysparam_<anyName>. Now check what are you getting.
var dob = this.getParameter('sysparm_id');//param from client script
ga.addParam('sysparm_id',newValue);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 02:52 AM
It’s working ! Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2024 01:00 AM
Hi @mikey97 ,
Be careful - your script will not calculate someone's age correctly based on the year alone. If I was born on 27th January 2000, even though I would be 23 today (26th Jan), your code would return 24.
You also need to determine if the current month and day is prior to the birthday month and day, and take one off the age if so.
This function works correctly: