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

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

View solution in original post

8 REPLIES 8
Dual Super User
Dual 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
New Member

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 ?

Dual Super User
Dual 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
New Member

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
Dual Super User
Dual 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
New Member

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

 

 

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

View solution in original post

wimmste
New Member

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

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 (8,067)