Flow initiation date-time for the current iteration

ashwinipingle
Tera Guru

Dear Flow experts,

We are using Strategic Portfolio Management in Xanadu patch 7.

We have created a flow for pm_project table. This flow has multiple Ask for Approval steps and this flow can be atarted allover again if there is a rejection for any of the Ask for Approval step. I am able to report on this flow executions using sysapproval_approver table. However I am not able to find the date-time when the current iteration of execution was started. Where can I get this information?

 

Best Regards,

Ashwini Pingle

 

 

1 ACCEPTED SOLUTION

Cheikh Ahmadou
Tera Guru

-> Use Flow Context and Custom Logging.
Here’s how to approach this:

1. Check sys_flow_context

This table stores each execution of a Flow Designer flow.

Steps:

  1. Navigate to System Flow > Contexts (sys_flow_context)

  2. Filter by:

    • Table = pm_project

    • Document = [your project sys_id]

  3. Sort by Start descending

Each entry is a new execution of the flow.
This gives you the start time of each iteration, since each restart (manual or system) creates a new context.

 

2. Optional: Tag Iterations with a Custom Field

If you want to explicitly track each flow round, consider:

Add a field to pm_project:

  • Name: u_last_flow_start_time

  • Type: Date/Time

Add a step at the beginning of the flow:

  • Update Record → pm_project

  • Set u_last_flow_start_time = now()

Now you’ll have an always-updated timestamp field with the most recent flow start.

 

 

3. (If Needed) Tie sysapproval_approver Back to Flow

If you want to map which sysapproval_approver records belong to which flow execution:

  • Link them via the context field in sysapproval_approver to sys_flow_context.sys_id

  • Or filter by sys_created_on between start and end of each flow context

View solution in original post

5 REPLIES 5

Cheikh Ahmadou
Tera Guru

-> Use Flow Context and Custom Logging.
Here’s how to approach this:

1. Check sys_flow_context

This table stores each execution of a Flow Designer flow.

Steps:

  1. Navigate to System Flow > Contexts (sys_flow_context)

  2. Filter by:

    • Table = pm_project

    • Document = [your project sys_id]

  3. Sort by Start descending

Each entry is a new execution of the flow.
This gives you the start time of each iteration, since each restart (manual or system) creates a new context.

 

2. Optional: Tag Iterations with a Custom Field

If you want to explicitly track each flow round, consider:

Add a field to pm_project:

  • Name: u_last_flow_start_time

  • Type: Date/Time

Add a step at the beginning of the flow:

  • Update Record → pm_project

  • Set u_last_flow_start_time = now()

Now you’ll have an always-updated timestamp field with the most recent flow start.

 

 

3. (If Needed) Tie sysapproval_approver Back to Flow

If you want to map which sysapproval_approver records belong to which flow execution:

  • Link them via the context field in sysapproval_approver to sys_flow_context.sys_id

  • Or filter by sys_created_on between start and end of each flow context

@Cheikh Ahmadou   - perfect. I was already thinking of option 2 but thought that maybe we can get the linkages between context and approval records from system itself. From your option 3 - it seems we need to make this connection. Thanks so much for your response. I can work on this.

 

Best Regards,

Ashwini Pingle

The code i had to use for setting datetime is as below

ashwinipingle_0-1747827091585.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@ashwinipingle 

can you share your current setup along with screenshots about the reporting on flow execution etc? how it's done?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader