We have avSharePoint list named Contracts with a Status dropdown with these options:-
New
Open
In Progress
First Approver
Second Approver
Manager Approver
Finance Review
Closed
Now we want to build a screen which will show the time it took a contract at each stage. Now I thought of building this as follow:-
To build a SharePoint list named “Logs”, with these fields:-
ID
ContractID
New
Open
In Progress
First Approver
Second Approver
Manager Approver
Finance Review
Closed
Now as the workflow moves, I will capture the current stage and calculate the time it took to move to next stage and so on.. then I will build a gallery inside our canvas app to show the Logs list data, with filter such as created on, contractID .
But before I start to build the above from scratch, today I though if there is a shorter approach I can follow, where I can benefit from the Contracts list version history ? to build the data I need?
Best approach to build a screen to show how long each stage took inside our Contract list
You would have to read the log file and create a collection with one row for each contract showing the different status times. The collection would have columns for each status which you would update from the log file.
Thanks a lot for the reply. But if i do not add a separate column for each status inside the Logs table, then how i can render the times in a table-like view inside the gallery? i need the gallery to show this info for multiple contracts and not just for one contract at a time , something as follow:-
So is this possible to achieve in a delegable way if i only use one column inside the Logs table to represents the different statuses? I can not think of doing so? any advice?
Best approach to build a screen to show how long each stage took inside our Contract list
If these are the only status fields that you will have then you can have a table similar to your logs table where you are storing the times that the status changes. You will update this record when the status changes with the time for each status so you can calculate the difference in times which will indicate the time taken to change status. Or you can have as mentioned below contractID, Status and Time, then you will have to combine the records to find the time difference,
Best approach to build a screen to show how long each stage took inside our Contract list
In my option, I would avoid to achieve by version history, because version history will loged when changes on every column, you will need to filter out the changes on Status column and then calculate the time, in short words, it can achieve, but it is complex.
For logs table, you can simply your table, I think you just need ContractId, status column and modify time, there is no need to add columns for each status. and then when Status changes, just insert the rows to logs table, you will be able to easily to render it on Gallery control.
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.