Asked by:
Update Data in List View

Question
-
Hi!
I am a long time lurker and have so many of my questions answered in this forum but am struggling to find a solution to this query.
I have a SharePoint list, the form was designed in InfoPath. There is are two fields which count the number of rows with a specific data in another list. This calculation is working perfectly. However when a list item changes in list 2, the number will update in list one but it will not show the updated number in the list view until you open the item and save or submit the data so the data shown in the list view is never accurate. I tried a rule to submit the data on field change but all that does is create another list item and not update the current list.
I hope all that makes sense!
Thanks in advance for any suggestions or help!
Dee
Wednesday, June 24, 2020 12:28 PM
All replies
-
if you store this number (number of rows in list2) in separate field (e.g. "Count") in list items of list1, then when items inside list2 are changed you need to go through all items in list1 and update "Count" field for them one by one. Your form won't help here because like you wrote it works only when it is opened in UI and re-submitted.
You may attach event receivers for list2 and inside them update items in list1. Start e.g. from here: Creating Simple Event Receiver in SharePoint 2013.
Blog - http://sadomovalex.blogspot.com
Dynamic CAML queries via C# - https://github.com/sadomovalex/camlexWednesday, June 24, 2020 3:34 PM -
Hello Dee,
You could create a workflow in the list 2 to update the item in your list 1.
The workflow logic would be like this:
Then workflow should be triggered when an item is created or changed in list2. In the workflow, you need to update item in list 1.Best Regards,
Michael Han
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
SharePoint Server 2019 has been released, you can click here to download it.
Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.
- Edited by Michael Han6 Thursday, June 25, 2020 8:26 AM
- Proposed as answer by Jerry Xu4869Microsoft contingent staff Monday, June 29, 2020 2:01 AM
Thursday, June 25, 2020 8:24 AM -
Hi,
Thanks so much for the reply, I am working with SP Designer I don't have access to Visual Studio.
Thanks again
Dee
Monday, June 29, 2020 9:16 AM -
Hello Dee,
Is there anything update?
Please remember to mark the reply as an answer if it helps you.
Best Regards,
Michael Han
Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
SharePoint Server 2019 has been released, you can click here to download it.
Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.Monday, June 29, 2020 9:17 AM -
Hi,
Thanks for the reply. I have tried this solution and wonder if I am missing something? I put in a dummy field and set the workflow to trigger on list 2 when item is created or changed. The workflow updates the dummy field. It updates perfectly (in both the list view and the item view) but the the other fields remain the same (until you open the list item where you can see that the number is still different.) So then I added a second field, and set this one to update after the dummy fires to = the value of the number field, this works but it still displays the old number (when you open the item the original field = the new number but the new field = the old number) I thought maybe putting a pause of 5 minutes after the first field update might help abut still no luck.
I'm totally stumped!
Dee
- Edited by Deeoz Monday, June 29, 2020 9:55 AM
Monday, June 29, 2020 9:54 AM -
Hi Michael,
Yes the dummy field updates no problem and then the duplicate number field also updates but it shows the old number (then when you open the item view the original field contains the correct number and the duplicate number field contains the wrong number!!!! If you just exit out of the form, the list view will still show the wrong number in both number fields until you go into the list view and hit save)
It's driving me crazy!
Dee
Monday, June 29, 2020 10:48 AM