cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Register downtime result in sharepoint list

Hi,

 

I am in the process of developing downtime registry in sharepoint list.

 

at the moment i am using this formula for patch

1.JPG

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

2.JPG

 

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 

3.JPG4.JPG5.JPG

 

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.

6.JPG7.JPG

 

Please let me know how to solve this issue.

8.JPG

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.

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

4 REPLIES 4
Community Support
Community Support

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.

 

Capture.JPG

 

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

View solution in original post

Helper III
Helper III

Thanks

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (51,854)