Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Best approach to build a screen to show how long each stage took inside our Contract list

Posted on by 1,374
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?

Any advice?
 
Thanks
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,167 on at
    Best approach to build a screen to show how long each stage took inside our Contract list
    Only a problem if you are accessing more than two thousand contracts at a time and it would be a bit slower.
     
    Each approach has its cons.
  • johnjohnPter Profile Picture
    johnjohnPter 1,374 on at
    Best approach to build a screen to show how long each stage took inside our Contract list
     
    but using collection means i can only hold max of 2,000 items.. which might  not always be the case
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,167 on at
    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.
  • johnjohnPter Profile Picture
    johnjohnPter 1,374 on at
    Best approach to build a screen to show how long each stage took inside our Contract list
     
     
    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?
    Thanks
     
  • Suggested answer
    ronaldwalcott Profile Picture
    ronaldwalcott 1,167 on at
    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,
  • Meekou Profile Picture
    Meekou 132 on at
    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.
     
    Regards,
    Meekou

Under review

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.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard