cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Patch data to sharepoint

Hi All,

 

I am trying to build application where i can patch data from Powerapps to sharepoint on job progress.

Any help is highly appreciated.

 

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.

Any help is highly appreciated.

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

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Dual Super User
Dual Super User

@Anonymous ,

gabibalaban_0-1632292622419.png

The second Patch() shouldn't be there and use ":" instead of "=" inside the record to be patch { .... }.

Give it a try ...

 

Also we should check the error on Start Time and End Time. Can you give some screenshots with the errors. 

 

View solution in original post

2 REPLIES 2
gabibalaban
Dual Super User
Dual Super User

@Anonymous ,

gabibalaban_0-1632292622419.png

The second Patch() shouldn't be there and use ":" instead of "=" inside the record to be patch { .... }.

Give it a try ...

 

Also we should check the error on Start Time and End Time. Can you give some screenshots with the errors. 

 

Anonymous
Not applicable

Hi @gabibalaban ,

 

Many thanks for your suggestions. It works great now!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,924)