cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tania986
New Member

Update a libray item in sharepoint : +1 to the current value

Hello, 

 

Long story short, I need to update an item of the librery and add +1 to the current field value. 

This is what I am doing: 

tania986_0-1638374634973.png

 

So when at the end of the day an item has status = In Progress then I update column Days in Progress in sharepoint. Days in Progress = Days in Progress +1. 

This is the expression I am using to update the Days in Progress field, using add to sum +1 and using also the fucntion coalesce to control the nulls in case the field is empty in sharepoint: 

 

tania986_1-1638374869986.png

 

add(1,coalesce(outputs('Get_files_(properties_only)')?['body/Days_x0020_in_x0020_Progress'],0))
 
Flow works and expressions looks ok but the issue is that does NOT take into account the value in the field. It works when the field doesnt contain any value and add 1.  But expressions doesnt sum the existing value in the field +1.
 
-> I had a similar issue with list and this solution worked. Not for libreries :(.
 
Could you please help to figure out ? thanks ! 
1 ACCEPTED SOLUTION

Accepted Solutions
iltoningui
Resolver II
Resolver II

Hi @tania986 

 

Try using 

add(1,coalesce(items('Apply_to_each')?['Days_x0020_in_x0020_Progress'],0))

 You can also filter the data from the get files action using

Status_x0020_Value eq 'In Progress'

this saves you from using the condition

View solution in original post

2 REPLIES 2
iltoningui
Resolver II
Resolver II

Hi @tania986 

 

Try using 

add(1,coalesce(items('Apply_to_each')?['Days_x0020_in_x0020_Progress'],0))

 You can also filter the data from the get files action using

Status_x0020_Value eq 'In Progress'

this saves you from using the condition

View solution in original post

tania986
New Member

Hi @iltoningui , 

thanks for your quick and correct response. I tried and its working !! 

The reason that i m not filtering the status in 'get files' is because i am going to add more status besides "In Progress". Actually, I think I will add a switch in the condicional since I will have like 4 or 5 different statuses. 

 

Thanks.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,202)