cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KnipeBolland
Frequent Visitor

Add Outputs Together

Hi,

 

I am building  a timesheet whichthe users enters the time they have worked on a project. What I want to do then is add the time worked on that entry to a secondary list which holds the total hours worked on a project. The idea is that with ever entry the time will total hours worked on a project will increase.

 

I have tried using the add function under the compose element but I cannot seem to get the function to work to update the field value.

 

Can anyone offer any help?

 

Many Thanks,

 

Karl

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Add Outputs Together

Hi @KnipeBolland,

 

Could you please share a screenshot of your flow's configuration?

Could you please show a bit more about the timesheet and the secondary list that you mentioned?

Further, do you want to add each worked hour entered in your timesheet into the total hours within the secondary list?

 

I suppose that there is a column which holds the total hours worked on a project in your secondary list, is it true? I have created a timesheet list (a SharePoint list) and a Secondary list (a SharePoint list) on my side and the data structure of it as below:24.JPG

Note: The ProjectName column and UserName column are both Single line of text type column, the Workhours column is a Number type column.

25.JPG

Note: The TotalWorkHours column is a Number type column and the default value of it is 0.

 

I have made a test on my side and please take a try with following workaround:

  • Add a "When an item is created" trigger, specify Site Address and List Name.
  • Add a Variables-> "Initialize variable" action, Name set to OriginalHoursValue, Type set to Float and Value set to empty.
  • Add a "Get items" action, specify Site Address and List Name, Filter Query field set to following formula:
ProjectName eq 'ProjectName dynamic content of the trigger'

Note: The dynamic content is wrapped with single quotes within above formula.

 

  • Add a "Apply to each" action, input parameter set to output of "Get items" action.
  • Within "Apply to each" action, add a "Set variable" action, Name choose OriginalHoursValue variable, Value set to TotalWorkHours dynamic content of "Get items" action.

         Add a "Increment variable" action, Name choose OriginalHoursValue variable, Value set to WorkHours dynamic content of the trigger.

         Add a "Update item" action, specify Site Address and List Name, Id field set to ID dynamic content of "Get items" action, TotalWorkHours field set to OriginalHoursValue variable.

 

Note: The OriginalHoursValue variable is used to store original worked hours value within my secondary list.

 

Image reference:26.JPG

 

27.JPG

The flow works successfully as below:28.JPG

When I entry two records in my timesheet list as below:29.JPG

The secondary list calculates well as below:30.JPG

 

 

 

Best regards,

Kris

 

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Add Outputs Together

Hi @KnipeBolland,

 

Could you please share a screenshot of your flow's configuration?

Could you please show a bit more about the timesheet and the secondary list that you mentioned?

Further, do you want to add each worked hour entered in your timesheet into the total hours within the secondary list?

 

I suppose that there is a column which holds the total hours worked on a project in your secondary list, is it true? I have created a timesheet list (a SharePoint list) and a Secondary list (a SharePoint list) on my side and the data structure of it as below:24.JPG

Note: The ProjectName column and UserName column are both Single line of text type column, the Workhours column is a Number type column.

25.JPG

Note: The TotalWorkHours column is a Number type column and the default value of it is 0.

 

I have made a test on my side and please take a try with following workaround:

  • Add a "When an item is created" trigger, specify Site Address and List Name.
  • Add a Variables-> "Initialize variable" action, Name set to OriginalHoursValue, Type set to Float and Value set to empty.
  • Add a "Get items" action, specify Site Address and List Name, Filter Query field set to following formula:
ProjectName eq 'ProjectName dynamic content of the trigger'

Note: The dynamic content is wrapped with single quotes within above formula.

 

  • Add a "Apply to each" action, input parameter set to output of "Get items" action.
  • Within "Apply to each" action, add a "Set variable" action, Name choose OriginalHoursValue variable, Value set to TotalWorkHours dynamic content of "Get items" action.

         Add a "Increment variable" action, Name choose OriginalHoursValue variable, Value set to WorkHours dynamic content of the trigger.

         Add a "Update item" action, specify Site Address and List Name, Id field set to ID dynamic content of "Get items" action, TotalWorkHours field set to OriginalHoursValue variable.

 

Note: The OriginalHoursValue variable is used to store original worked hours value within my secondary list.

 

Image reference:26.JPG

 

27.JPG

The flow works successfully as below:28.JPG

When I entry two records in my timesheet list as below:29.JPG

The secondary list calculates well as below:30.JPG

 

 

 

Best regards,

Kris

 

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

SandraAkujobi Helper IV
Helper IV

Re: Add Outputs Together

how would yoou apply this to individual projects and during different days. I s there a way to calculate a project weekly?

Helpful resources

Announcements
Did you attend MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’ve streamed the digital event live, or you're watching on-demand, claim your attendee badge to sport on your profile.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (5,325)