Hi,
I am trying to complete an app to register the downtime registry.
the app intention is to work in this way. when the operator experience a downtime, they will register the start of downtime by choosing their name,machine,downtime reason and patch button, it will make a registry in sharepoint list, and when the downtime finish, operator will once again press the patch and it will lookup by operator name, machine & start time value and then register the finish time on that particular registry.
at the moment i am using these code
Set(varItem, LookUp(Downtime, Operator = Operator_dropdown_1.SelectedText.Value && Machine= Machine_dropdown_1.SelectedText.Value && Reason.Value= Reason_dropdown.SelectedText.Value ));
If(
IsBlank(varItem)||(!IsBlank(varItem.Start)&&!IsBlank(varItem.Finish)),
Patch(
Downtime,
Defaults(Downtime),
{
Operator:Operator_dropdown_1.SelectedText.Value,
Start:Now(),
Machine:Machine_dropdown_1.SelectedText.Value,
Reason:Reason_dropdown.SelectedText
}
),
Patch(
Downtime,
varItem,
{
Finish: Now()
}
)
)
the problem experienced now is that app is working good for the 1st registry of a downtime reported by an operator from a machine, when the same downtime registered by the same operator from same machine later on the day, it is creating a new registry as required, but it is not looking up and registering the finish time for the new registry of same downtime registry from same operator from same machine, instead it is creating again a new registry with start time.
any help is highly appreciated.
Thanks in advance.
