- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 07:29 PM
Hi,
With 'created or updated' trigger and run trigger as 'only if not currently running', once a flow is triggered and moves into 'wait for duration of time after' state (waiting for start date) , Now if record is updated e.g. start date is updated, the flow runtime value in wait for duration step is not updated, shows original start date value.
Not sure if this is FD limitation in NY release..how can I update the runtime value or update/restart the flow with new updated record?
Thanks!
Solved! Go to Solution.
- Labels:
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 08:50 PM
You cannot re-run the flow.
So cancel the previous context and start new one.
You can start the flow again via script possibly after update BR when Start Date is Updated
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var rec = new GlideRecord('sys_flow_context');
rec.addQuery('name','Flow Name Here');
rec.addQuery('source_record', current.sys_id);
rec.addQuery('state', 'IN_PROGRESS');
rec.query();
if(rec.next()){
rec.state = 'CANCELLED';
rec.update();
}
var inputs = {};
inputs['current'] = current;
inputs['table_name'] = current.getTableName();
// Execute the global flow called test_flow
sn_fd.FlowAPI.executeFlow('Flow Name Here', inputs);
})(current, previous);
Refer: Scripting with Flows, Subflows, and Actions
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 08:50 PM
You cannot re-run the flow.
So cancel the previous context and start new one.
You can start the flow again via script possibly after update BR when Start Date is Updated
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var rec = new GlideRecord('sys_flow_context');
rec.addQuery('name','Flow Name Here');
rec.addQuery('source_record', current.sys_id);
rec.addQuery('state', 'IN_PROGRESS');
rec.query();
if(rec.next()){
rec.state = 'CANCELLED';
rec.update();
}
var inputs = {};
inputs['current'] = current;
inputs['table_name'] = current.getTableName();
// Execute the global flow called test_flow
sn_fd.FlowAPI.executeFlow('Flow Name Here', inputs);
})(current, previous);
Refer: Scripting with Flows, Subflows, and Actions
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 06:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 09:27 PM
create restricted caller access record
1) left nav type Restricted caller
2) create new record
3) Give source scope as your Custom Scope and details as per image below
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2020 01:48 AM
Hope you are doing good.
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader