cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
wimmste
Level: Power Up

How to update an item in a SharePoint list based on the changes from another SharePoint List?

I have two lists  a Person List and a Course List.

I need to count down 1 in the "Seats" Column when the "AC Date" is choosen in the Person List, so i know how many Seats are left in the course.

The "AC Date" Column is a lookup from Course List.

"ACDateLocation" is a Single line Text Column.

 

HR1.jpg

HR2.jpg

I would be very happy about your help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

Hi @wimmste 

 

Yes! So the flow currently counts down every time you have modified/created the item and there is any value in the courses column (Based on your request initially). For the dyamically changing values, you will have to build equivalent logic in the flow to count for events such as multiple edits on an item not related to the course lookup, change in the selection of the course lookup etc. 

 

In this case, I would suggest you to use a calculated field in sharepoint itself instead of using flow (to make things easier)

 

Hope this Helps! 

8 REPLIES 8
Super User
Super User

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

Hi @wimmste 

 

Please refer to the screenshot below and replicateTas1.png

 

tas2.png

Expression used for Seats 

add(body('Get_item')?['Seats'],-1)

The ID in update Item is referring to the ID retrieved from the Get Item action. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

wimmste
Level: Power Up

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

Cool fast response thank you.

 

But whats the "length(...)" expression for the Condition ?

Super User
Super User

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

Hey @wimmste 

 

Sorry I missed that in the previous response, the expression used is 

length(triggerBody()?['Courer']?['Value'])

Here I am checking if there is some value in the lookup field. You can type length in the expression editor and select the Course Value from the dynamic selector (within the bracket of the length function)

 

Hope this Helps!

wimmste
Level: Power Up

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

@yashag2255 

i get an Error in the Condition:

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '46741': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#length for usage details.'.

 

My Condition:

length(triggerbody()?['AC_x0020_Date']?['Value'])
 
My Flow:
HR3.jpg
Super User
Super User

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

Hi @wimmste 

 

Please update the flow condition as shown in the screenshotdd.png

Expression:

 

empty(triggerBody()?['Courer']?['Value'])

The condition is not equal to and the value on right side is true (type in the expression editor and select the value true)

 

Hope this Helps!

wimmste
Level: Power Up

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

@yashag2255 

Thx for your patience, i am really new to this complex Flows ;-)

 

The Flow is counting down everytime i am updating or adding a item in the person List.

It should be 4 Seats on all Items in the Course List.

 

Maybe i need a help column so the workflow knows that it already count down for that Item in the person list.

hr8.jpg

hr7.jpg

hr9.jpg

 

My Flow now:

hr10.jpg

 

 

Super User
Super User

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

Hi @wimmste 

 

Yes! So the flow currently counts down every time you have modified/created the item and there is any value in the courses column (Based on your request initially). For the dyamically changing values, you will have to build equivalent logic in the flow to count for events such as multiple edits on an item not related to the course lookup, change in the selection of the course lookup etc. 

 

In this case, I would suggest you to use a calculated field in sharepoint itself instead of using flow (to make things easier)

 

Hope this Helps! 

wimmste
Level: Power Up

Re: How to update an item in a SharePoint list based on the changes from another SharePoint List?

Thx i will try that now.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand 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: 196 members 4,368 guests
Please welcome our newest community members: