cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jjasper
Helper III
Helper III

Powerapp no longer saving to sharepoint and updating

Hello, 

 

I have an app that updates a sharepoint list each month. Until recently it has worked, the item would be updated in the app and in sharepoint but now it won't do either. You can enter the number and hit save but it does nothing. I am using Patch to patch the data to sharepoint. It started with when the number was entered and saved it wouldn't refresh the number but now it is not saving at all. 

 

Here is the code that I am using. 

 

 

Patch(SRSIndicators, LookUp(SRSIndicators, ID=ThisItem.ID && Year=2020), {January: Value(LookUp(Gallery6_3.AllItems, month=1).TextInput1_3.Text), February: Value(LookUp(Gallery6_3.AllItems, month=2).TextInput1_3.Text), March: Value(LookUp(Gallery6_3.AllItems, month=3).TextInput1_3.Text), April: Value(LookUp(Gallery6_3.AllItems, month=4).TextInput1_3.Text), May: Value(LookUp(Gallery6_3.AllItems, month=5).TextInput1_3.Text), June: Value(LookUp(Gallery6_3.AllItems, month=6).TextInput1_3.Text), July: Value(LookUp(Gallery6_3.AllItems, month=7).TextInput1_3.Text), August: Value(LookUp(Gallery6_3.AllItems, month=8).TextInput1_3.Text), September: Value(LookUp(Gallery6_3.AllItems, month=9).TextInput1_3.Text), October: Value(LookUp(Gallery6_3.AllItems, month=10).TextInput1_3.Text), November: Value(LookUp(Gallery6_3.AllItems, month=11).TextInput1_3.Text), December: Value(LookUp(Gallery6_3.AllItems, month=12).TextInput1_3.Text)}); Patch(colSRS, LookUp(colSRS, ID=ThisItem.ID), {January: Value(LookUp(Gallery6_3.AllItems, month=1).TextInput1_3.Text), February: Value(LookUp(Gallery6_3.AllItems, month=2).TextInput1_3.Text), March: Value(LookUp(Gallery6_3.AllItems, month=3).TextInput1_3.Text), April: Value(LookUp(Gallery6_3.AllItems, month=4).TextInput1_3.Text), May: Value(LookUp(Gallery6_3.AllItems, month=5).TextInput1_3.Text), June: Value(LookUp(Gallery6_3.AllItems, month=6).TextInput1_3.Text), July: Value(LookUp(Gallery6_3.AllItems, month=7).TextInput1_3.Text), August: Value(LookUp(Gallery6_3.AllItems, month=8).TextInput1_3.Text), September: Value(LookUp(Gallery6_3.AllItems, month=9).TextInput1_3.Text), October: Value(LookUp(Gallery6_3.AllItems, month=10).TextInput1_3.Text), November: Value(LookUp(Gallery6_3.AllItems, month=11).TextInput1_3.Text), December: Value(LookUp(Gallery6_3.AllItems, month=12).TextInput1_3.Text)})

 

 Any help is greatly apricated as I need to get this back up and running ASAP. 

 

TIA

4 REPLIES 4
Drrickryp
Super User II
Super User II

Hi @jjasper 

The first thing that caught my attention was the LookUp(SRSIndicators, ID=ThisItem.ID && Year=2020). Could you just filter the gallery by year and use  LookUp(SRSIndicators, ID=ThisItem.ID) to select the correct record to patch?  Also take a look at the With() function to simplify your formula. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-with .  This could help prevent a typo from ruining your formula.

v-bofeng-msft
Community Support
Community Support

Hi @jjasper :

Could you tell me if this code was useful before?

First,as suggested by @Drrickryp , confirm that the code "LookUp(SRSIndicators, ID=ThisItem.ID && Year=2020)" is valid.

Second,create a custom collection to check whether this code can get the correct result

 

 

ClearCollect(customcollection,
{January: Value(LookUp(Gallery6_3.AllItems, month=1).TextInput1_3.Text), February: Value(LookUp(Gallery6_3.AllItems, month=2).TextInput1_3.Text), March: Value(LookUp(Gallery6_3.AllItems, month=3).TextInput1_3.Text), April: Value(LookUp(Gallery6_3.AllItems, month=4).TextInput1_3.Text), May: Value(LookUp(Gallery6_3.AllItems, month=5).TextInput1_3.Text), June: Value(LookUp(Gallery6_3.AllItems, month=6).TextInput1_3.Text), July: Value(LookUp(Gallery6_3.AllItems, month=7).TextInput1_3.Text), August: Value(LookUp(Gallery6_3.AllItems, month=8).TextInput1_3.Text), September: Value(LookUp(Gallery6_3.AllItems, month=9).TextInput1_3.Text), October: Value(LookUp(Gallery6_3.AllItems, month=10).TextInput1_3.Text), November: Value(LookUp(Gallery6_3.AllItems, month=11).TextInput1_3.Text), December: Value(LookUp(Gallery6_3.AllItems, month=12).TextInput1_3.Text)}); Patch(colSRS, LookUp(colSRS, ID=ThisItem.ID), {January: Value(LookUp(Gallery6_3.AllItems, month=1).TextInput1_3.Text), February: Value(LookUp(Gallery6_3.AllItems, month=2).TextInput1_3.Text), March: Value(LookUp(Gallery6_3.AllItems, month=3).TextInput1_3.Text), April: Value(LookUp(Gallery6_3.AllItems, month=4).TextInput1_3.Text), May: Value(LookUp(Gallery6_3.AllItems, month=5).TextInput1_3.Text), June: Value(LookUp(Gallery6_3.AllItems, month=6).TextInput1_3.Text), July: Value(LookUp(Gallery6_3.AllItems, month=7).TextInput1_3.Text), August: Value(LookUp(Gallery6_3.AllItems, month=8).TextInput1_3.Text), September: Value(LookUp(Gallery6_3.AllItems, month=9).TextInput1_3.Text), October: Value(LookUp(Gallery6_3.AllItems, month=10).TextInput1_3.Text), November: Value(LookUp(Gallery6_3.AllItems, month=11).TextInput1_3.Text), December: Value(LookUp(Gallery6_3.AllItems, month=12).TextInput1_3.Text)})

 

 

Finally,Is there any error in this app? Could you provide a screenshot of the error?

Best Regards,

Bof

The code was working before and useful before. When I first created the app I had someone help me build it and this is the code they supplied and it work great for 2019. For 2020 not so much. I have fixed the code and I no errors in the app now. But it still won't save to SharePoint and update. I am unsure what has changed from last year to this year other than the filters. I have changed the app to go to a different SharePoint list so there is no need for the year filter. I have fixed all connections and have no errors in the app but it still isn't work. I am unsure what to do or even what to search for to help fix my error. If you can guide me that would be great. I need to get this back up running ASAP so we can run our reports. 

 

TIA

Hi @jjasper :

Please try if this code:

 

Patch(SRSIndicators, Defaults(SRSIndicators), {January: Value(LookUp(Gallery6_3.AllItems, month=1).TextInput1_3.Text), February: Value(LookUp(Gallery6_3.AllItems, month=2).TextInput1_3.Text), March: Value(LookUp(Gallery6_3.AllItems, month=3).TextInput1_3.Text), April: Value(LookUp(Gallery6_3.AllItems, month=4).TextInput1_3.Text), May: Value(LookUp(Gallery6_3.AllItems, month=5).TextInput1_3.Text), June: Value(LookUp(Gallery6_3.AllItems, month=6).TextInput1_3.Text), July: Value(LookUp(Gallery6_3.AllItems, month=7).TextInput1_3.Text), August: Value(LookUp(Gallery6_3.AllItems, month=8).TextInput1_3.Text), September: Value(LookUp(Gallery6_3.AllItems, month=9).TextInput1_3.Text), October: Value(LookUp(Gallery6_3.AllItems, month=10).TextInput1_3.Text), November: Value(LookUp(Gallery6_3.AllItems, month=11).TextInput1_3.Text), December: Value(LookUp(Gallery6_3.AllItems, month=12).TextInput1_3.Text)}); Patch(colSRS, LookUp(colSRS, ID=ThisItem.ID), {January: Value(LookUp(Gallery6_3.AllItems, month=1).TextInput1_3.Text), February: Value(LookUp(Gallery6_3.AllItems, month=2).TextInput1_3.Text), March: Value(LookUp(Gallery6_3.AllItems, month=3).TextInput1_3.Text), April: Value(LookUp(Gallery6_3.AllItems, month=4).TextInput1_3.Text), May: Value(LookUp(Gallery6_3.AllItems, month=5).TextInput1_3.Text), June: Value(LookUp(Gallery6_3.AllItems, month=6).TextInput1_3.Text), July: Value(LookUp(Gallery6_3.AllItems, month=7).TextInput1_3.Text), August: Value(LookUp(Gallery6_3.AllItems, month=8).TextInput1_3.Text), September: Value(LookUp(Gallery6_3.AllItems, month=9).TextInput1_3.Text), October: Value(LookUp(Gallery6_3.AllItems, month=10).TextInput1_3.Text), November: Value(LookUp(Gallery6_3.AllItems, month=11).TextInput1_3.Text), December: Value(LookUp(Gallery6_3.AllItems, month=12).TextInput1_3.Text)})

 

If the above code is allowed, a new record is added to your data source. There is a problem with the description code "LookUp(SRSIndicators, ID=ThisItem.ID && Year=2020)".(The code cannot find the specified record and cannot be updated)

Best Regards,

Bof

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,024)