web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch data to sharepoint
Power Apps
Unanswered

Patch data to sharepoint

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

 

2.JPG

 

1.JPG

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

3.JPG

 

Categories:
I have the same question (0)
  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    This code is without Start and finish time. First try 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), 
     { Product : Process_dropdown.Selected.Value,
     Equipment : Equipment_dropdown.Selected.Value,
     Process : Process_dropdown.Selected.Value,
     Batchno : Batchno_Textinput.Text 
     }
    
    		) //Patch End
     
     ) //Set End
     ) //Second With
    
    ) //First With

     

     

    I believe you are trying Start and Finish time added only a new record. is it correct? Let me know how this works and will add Start and Finish time

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Still its making different line registry, i pressed button 3 times and it made 3 different entry1.JPG

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @StalinPonnusamy ,

     

    I tried, but it still making 3 different registry when i pressed Button 3 times.

    1.JPG

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    I created something similar to your structure and tried.

    With(
     {
     dataItem: // Your Record
    LookUp(
     SortByColumns(
     Test_MDP,
     "Start",
     Descending
     ),
     Product.Value = Product_dropdown.Selected.Value && Equipment.Value = Equipment_dropdown.Selected.Value && Process.Value = Process_dropdown.Selected.Value && Batchno = Batchno_Textinput.Text
     )
     },
     With(
     {newTrue: // Your criteria for a new record
    (IsEmpty(dataItem)) || (IsBlank(dataItem)) || (!IsBlank(dataItem.Start) && !IsBlank(dataItem.Finish))},
     // Your Patch to the DataSource
     Patch(
     Test_MDP,
     If(newTrue, Defaults(Test_MDP), dataItem),
     {
     Product: Product_dropdown.Selected,
     Process : Process_dropdown.Selected,
     Equipment: Equipment_dropdown.Selected,
     Batchno: Batchno_Textinput.Text
     },If(newTrue, {Start:Now()}, {Finish:Now()})
     )//Patch End
     )//Second With
    )//First With

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    For Reference (If I missed any typo) - Note: Not used process dropdown on this example

    StalinPonnusamy_0-1632375300470.png

     

    StalinPonnusamy_1-1632375321332.png

     

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Please let us know if anything needs on your post. We can help with this.


    Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard