Hi,
I am in the process of developing downtime registry in sharepoint list.
at the moment i am using this formula for patch
If(
IsBlank(LookUp(Downtime, Operator.Value = Operator_dropdown_1.SelectedText.Value && Machine.Value = Machine_dropdown_1.SelectedText.Value && Reason.Value= Reason_dropdown_1.SelectedText.Value )),
Patch(
Downtime,
Defaults(Downtime),
{
Operator: Operator_dropdown_1.SelectedText,
Start: Now(),
Machine: Machine_dropdown_1.SelectedText,
Reason: Reason_dropdown_1.SelectedText
}
),
Patch(
Downtime,
LookUp(Downtime, Operator.Value = Operator_dropdown_1.SelectedText.Value && Machine.Value = Machine_dropdown_1.SelectedText.Value && Reason.Value= Reason_dropdown_1.SelectedText.Value),
{
Finish: Now()
}
)
)
the value get stored in sharepoint list
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.
like below
the problem i face now is i cant make the registry if the downtime is repeating multiple times per day by same operator & machine. example if operator have 3 breakes per day, app can only register the ist downtime registry for the operator & machine choosen. it is not registering the for the second time.
when i do that it simply updating the finish time & not creating new registry.
Please let me know how to solve this issue.
Please can you recommend me wwhat kind of changes in the formula i need to use inorder to get such result from the app.
i was thinking, if operator & machine & downtime reason remains constant the only variable can be the ID number, is there someway to create a new registry by including ID number as a serach option in Lookup for patching value in sharepoint?
any help is highly appreciated.
Thanks.
Solved! Go to Solution.
Hi @Vinoth1_ ,
Another solution is filter out all completed registry first. Please try this:
Set(varItem, LookUp(Filter(Downtime,Start=Blank() || Finish=Blank()), Operator.Value = Operator_dropdown_1.SelectedText.Value && Machine.Value = Machine_dropdown_1.SelectedText.Value && Reason.Value= Reason_dropdown_1.SelectedText.Value ));
If(
IsBlank(varItem),
Patch(
Downtime,
Defaults(Downtime),
{
Operator: Operator_dropdown_1.SelectedText,
Start: Now(),
Machine: Machine_dropdown_1.SelectedText,
Reason: Reason_dropdown_1.SelectedText
}
),
Patch(
Downtime,
varItem,
{
Finish: Now()
}
)
)
Hope this helps.
Sik
Hi @Vinoth1_ ,
I believe here is a easy way that check if both Start and Finish field have value. If both are filled, then create a new registry. Please try this:
Set(varItem, LookUp(Downtime, Operator.Value = Operator_dropdown_1.SelectedText.Value && Machine.Value = Machine_dropdown_1.SelectedText.Value && Reason.Value= Reason_dropdown_1.SelectedText.Value ));
If(
IsBlank(varItem)||(!IsBlank(varItem.Start)&&!IsBlank(varItem.Finish)),
Patch(
Downtime,
Defaults(Downtime),
{
Operator: Operator_dropdown_1.SelectedText,
Start: Now(),
Machine: Machine_dropdown_1.SelectedText,
Reason: Reason_dropdown_1.SelectedText
}
),
Patch(
Downtime,
varItem,
{
Finish: Now()
}
)
)
Hope this helps.
Sik
Hi @v-siky-msft ,
Thanks for your help.
I used the formula described, for the 2nd entry of same downtime by same operator & same machine, it is creating a new registry for start, but unfortunately when i try to end the registry of downtime registry to finish, it keeps on making a new registry with start time, but now looking up and updating the finish time for the 2nd entry.
any help is highly appreciated, what changes should i need to make to solve this issue?
Thanks in advance.
Hi @Vinoth1_ ,
Another solution is filter out all completed registry first. Please try this:
Set(varItem, LookUp(Filter(Downtime,Start=Blank() || Finish=Blank()), Operator.Value = Operator_dropdown_1.SelectedText.Value && Machine.Value = Machine_dropdown_1.SelectedText.Value && Reason.Value= Reason_dropdown_1.SelectedText.Value ));
If(
IsBlank(varItem),
Patch(
Downtime,
Defaults(Downtime),
{
Operator: Operator_dropdown_1.SelectedText,
Start: Now(),
Machine: Machine_dropdown_1.SelectedText,
Reason: Reason_dropdown_1.SelectedText
}
),
Patch(
Downtime,
varItem,
{
Finish: Now()
}
)
)
Hope this helps.
Sik
Thanks
User | Count |
---|---|
179 | |
113 | |
88 | |
44 | |
42 |
User | Count |
---|---|
225 | |
113 | |
112 | |
69 | |
67 |