Issue with current being undefined in Flow Designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2022 08:58 AM
I'm using Flow Designer to send a reminder email to approvers that they have pending approvals to perform. I also want to increment a field to show how many times the notification had to be sent before action was performed. This should be a simple script to update the counter, but I'm running into the following error. 'attempting to use undefined input = 'current' from' This looks up records from the sysapproval_approver table and sends an email based on each approval waiting. I have that part working, however the following code is giving me issues (the field u_number_of_reminders is already created and on the form).
/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var x = fd_data.trigger.current.u_number_of_reminders;
x++;
return x;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 05:02 AM
Your flow is triggerd as 'daily at' ... with that the flow has no triggering record. fd_data.trigger accesses triggering records.
In your case you will need to use the data pills to get to the record currently being processed. From the top of my head it would need to look something like:
fd_data.for_each_2.approval_record._number_of_reminders.
Not sure on the exact notation... but close 😄

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 06:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 02:12 AM
How about you define a flow variable and use the set variable action to set and increment it? Didn't try but could work.
As for a 'simple' increment Math function, feel empowered to raise an idea - our PM's are listening 😄

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2022 08:29 AM
So I ended up taking it a different way. I created a flow variable first, then pulled the value from the u_number_of_reminders field. I incremented it and then set it back into the field. This link below gave me the information to be able to do it.