I have a 2 Sharepoint lists which are linked by a number field called "tripid"
The first list is Trips and contains details of people's field trips, the second list is called TripDetails and it contains a record for every day the person is out on the trip - this could be just 1 day or up to 10 days - both lists have the tripid field which is how I link them in my app.
I have a form for the Trip and it's Items property is set to a Gallery that the user goes to first to select which trip they want to update. Next to the form on the same screen I have a Gallery for TripDetails and it's Items property is also set to the Gallery. I can easily update data in the Form by just using SubmitForm(TripForm2_3) but I want to also update the TripDetails.
I have put a button on the bottom of the screen and it's On Select property is:
Patch(TripDetails,
ForAll(Gallery6_4.AllItems As _item,
{ tripid: _item.tripid,
tripdate: DateValue(_item.DatePicker1_1.SelectedDate),
destination: _item.TextInput2_25.Text,
activity: _item.TextInput2_27.Text,
accomodation: _item.TextInput2_29.Text,
localcontact: _item.TextInput2_28.Text,
callintimes: _item.TextInput2_30.Text,
hoursworked: _item.TextInput2_31.Text
}
)
)
I can go the Gallery and make changes to the data but when I try to update by clicking the button my code is adding new data to the list instead of just updating the existing data, so if I had 5 rows in the Gallery after I click the button I end up with 10 rows - how can I just UPDATE and not create new (I thought it would only create new records if I used (Defaults)??
any help greatly appreciated