I have a Gallery which displays a summary of all records in my Sharepoint lists. From that Gallery I can select a record and navigate to a different screen which has an Edit Form and a Gallery in it. The Form and the Gallery are linked by a "tripID' field which exists in both lists.
When I click on the edit icon from the main Gallery the OnSelect property updates a collection which I continue to work with:
ClearCollect(
colDetails,
Filter(
TripDetails,
tripid = (Gallery5.Selected.tripid)
)
);
On the next screen the Gallery's Items property is simply:
SortByColumns(colDetails,"tripdate")
In this Gallery I need to add days to an existing trip or change dates and other information about the trip. I have an add row icon and it's properties are:
Patch(
colDetails,
Defaults(colDetails),
{
tripid: Value(TextInput2_26.Text),
tripdate: Gallery6_4.Selected.tripdate,
destination: TextInput2_25.Text,
activity: TextInput2_27.Text,
localcontact: TextInput2_28.Text,
accomodation: TextInput2_29.Text,
callintimes: TextInput2_30.Text,
hoursworked: TextInput2_31.Text
}
);
I can add a row and edit the data but sometimes if I change the date it will change one of the other existing dates and I have to change it back or delete that row and re-add one. That's a minor problem compared with my bigger problem which is when I come to submit the records to my datasource it doesn't work - here is the code for that:
ForAll(
colDetails,
Patch(
TripDetails,
LookUp(TripDetails,ID=Value(TextInput2_32.Text)),
{
tripid: tripid,
tripdate: DateValue(DatePicker1_1.SelectedDate),
destination: TextInput2_25.Text,
activity: TextInput2_27.Text,
accomodation: TextInput2_29.Text,
localcontact: TextInput2_28.Text,
callintimes: TextInput2_30.Text,
hoursworked: TextInput2_31.Text
}
)
)
);
I don't get any error messages but it doesn't add any new records that I have added to the collection however any edits that I make to existing records do update the Sharepoint list. I think I am missing something obvious but can't work out what it is - can anyone help please?