Hi all,
so I am fairly new to powerapps and I am having a hard time trying to figure out why a record is not being updated when I make changes to it.
Some background first I guess. -
Basically I have a Stationery request list in Sharepoint. It has around 90 columns, one for each time of item that can be ordered. From this I have created a customize form in powerapps.
In powerapps I have a few screens(Intro Screen, MonthlyOrdersNew, MonthlyOrdersEdit and ApproversScreen. The intro screen which has a selection of locations(for each house that needs to do a stationary order). When the user clicks on their house, it will take them to either a new form to fill out or a current order to update/approver. The button uses a variable in the code called varlocid along with a value that is linked to the location they are submitting the form for . On the new form fields like their location, who the approver is, and who submitted the form are all automatically filled in. On this new form page is a 3 column sharepointform with the datasource being the sharepoint list that has all 90 or so items that can be ordered along with sliders for the the number of items of each type that can be ordered at anyone time. They fill it out and hit the Submit Order button. This then records the record and returns them back to the IntroScreen. Then because there is now an order in place, a label shows on that location stating there is a current order. If they press on the button now, instead of going to a MonthlyOrdersNew screen, it goes to the MonthlyOrderEdit screen and displays the form using data from that record. It knows to do this via the variable varlocid.
The whole form is meant to only ever show them the screens and not the entered data back in sharepoint. I do this via the Launch command to ensure they either go to the IntroScreen or back to our internal homepage.
Side Note but probably important. Both SharePointFormNew and SharePointFormEdit(the names I gave to each sharepoint form under new and edit screens) have the datacards for all items and the colums for such things as LocID, Createdby, Location etc and are hidden and they are pulling data across. And I have a second Sharepoint List that has information about approvers, emails for them and the Locations and their associated ID(which varlocid and LocID refer to). And I have in the SharePointFormNew the data source correctly set and in the SharePointFormEdit I have the data source and the Item set. In the item field I have the following -
"LookUp('Stationary_&_First_Aid_list', LocID=Text(varlocid))"
- This works and shows the record and the data within.
The issue I am having is when I am in the MonthlyOrdersEdit screen and I change any of the Items and I want to update the original record I am working in, it will not at all update.
It does not matter if I use UpdateIf, Update, Patch, SubmitForm commands. Nothing wants to update the original form record.
I keep reading about those who use the Gallery function and the usual thing to do is simply use the SubmitForm command. So in my case I would put SubmitForm(SharePointFormEdit) but this does not work.
So I am wondering if maybe somewhere else in the whole setup I have set something incorrectly. Or I am just doing it all the hard way. I originally also had a comments box for misc orders but that also refused to update the original record when I made changes to it. I tried using in some of the formula after datasource, LocID=Text(varlocid) and this shows the correct ID for that location for that record, but I feel like this is wrong somehow. I feel like I need to be referencing every single column in the list in order for it to update the entire record rather than referencing SharePointFormEdit and the varlocid variable to update it.
Please help.