cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tania986
Regular Visitor

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
Super User
Super User

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
Super User
Super User

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

tania986
Regular Visitor

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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,155)