- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 12:56 AM - edited ‎02-21-2025 01:24 AM
I have a integer field on a table that needs to be incremented when it meets some conditions in subflow. Irrespective of what I try and logs showing integer value as expected , but runtime value under action returns 1.0,2.0 etc (I'm using update record action and trying to set field value using script). I'm testing this from test button on subflow
var newCount = parseInt(fd_data.subflow_inputs.XX.yy) + 1;
var newCount2 = parseInt(fd_data.subflow_inputs.XX.yy) + parseInt(1);
var newCount3 = fd_data.subflow_inputs.XX.yy + 1;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 01:32 AM
Deleted a old field and created this and updated it under script for setting field value , but didn't update the field name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 01:02 AM
The script seems like the field you're working with is being treated as a float or decimal (hence the 1.0, 2.0 behavior), but you're working with an integer in your logic.
Can you verify with the following Script:
e.g. var newCount = Math.floor(parseFloat(fd_data.subflow_inputs.XX.yy)) + 1;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 01:17 AM
ensure your type for your subflow output variable is integer
what's the output variable type?
share screenshots.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2025 01:32 AM
Deleted a old field and created this and updated it under script for setting field value , but didn't update the field name