Hi All,
I am trying to build application where i can patch data from Powerapps to sharepoint on job progress.
The application intention is very simple to make a production output entries, when we register 1st time a batch no, product,equipment ,process with start time - it creates a new registry. then when we patch again, it finds the previous start registry and enters the finish time.
and to create multiple registry for the same process the same day.
Can you suggest me what should i improve in my formula? to get such result.


Start & Finish time in PowerApps has this code on text filter
glbR.Start
glbR.Finish
Button onselect property was this
With({dataItem: // Your Record
LookUp(SortByColumns(Test_MDP, "Start", Descending),
Product = Process_dropdown.Selected.Value &&
Equipment= Equipment_dropdown.SelectedText.Value &&
Process = Process_dropdown.SelectedText.Value &&
Batchno = Batchno_Textinput.Text
)},
With({newTrue: // Your criteria for a new record
(IsBlank(dataItem.Start) && IsBlank(dataItem.Finish)) ||
(!IsBlank(dataItem.Start) && !IsBlank(dataItem.Finish))
},
// Your Patch to the DataSource
Set(glbR,
Patch(Test_MDP,
If(newTrue, Defaults(Test_MDP), dataItem),
Patch(
{ Product = Process_dropdown.Selected.Value,
Equipment = Equipment_dropdown.SelectedText.Value,
Process = Process_dropdown.SelectedText.Value,
Batchno = Batchno_Textinput.Text
},
If(newTrue, {Start:Now()}, {Finish:Now()})
)
)
)
)
)
but its showing me a lot of error on this program
