cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KnipeBolland
Level: Powered On

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
Community Support Team
Community Support Team

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.
1 REPLY 1
Community Support Team
Community Support Team

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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 274 members 4,632 guests
Please welcome our newest community members: