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 a SharePoint Eve...
Power Apps
Answered

Patch a SharePoint Event List not working.

(0) ShareShare
ReportReport
Posted on by 142

I was able to use a form and post to event list.Form_Add_Event.JPG

I just use SubmitForm(Form1);  and I new event list was added to event list.

I change to patch with the following code nothing happening when I click do the patch and no entry was added

 

Patch(
RoundingCalendar,
Defaults(RoundingCalendar),
{
Title: "Testing ",
Location: "SM",
EventDate : GalleryRoundsSchedule_1.Selected.EventDate,
EndDate : GalleryRoundsSchedule_1.Selected.EndDate,
R_Location : {Id: RoundsUnitId, Value: RoundsUnit},
Author : {
'@odata.type': "#Mcrosoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & User().Email,
Department: "",
DisplayName: User().FullName,
Email: User().Email,
JobTitle: "",
Picture: ""
},
Created : Now()
}
);

 

Please help.

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

    @skong 

    If you have a form, why are you using Patch then?  Your original SubmitForm on the form seemed to work as you indicate.

     

  • skong Profile Picture
    142 on at

    Yes, submit form work fine. I would like to use Patch since it is more flexible. I also send email and do other stuff after I added a new entry on the event list. 

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @skong 

    You are misunderstanding the form then as you will have much more functionality and control with a form than you will with Patch.

    If you need to do additional actions after a submit, then you need look no further than the OnSuccess action of the form.  This is where you do any "after-the-submit" is successful actions.

    The form will also provide you with the OnFailure for when there are failures as well as a slew of other properties that would take you a lot of formulas to achieve - Unsaved, Valid, Updates, etc.

    So, in other words, work with your form as you will have much more flexibility and options with it than you will trying to do the patch yourself.

    In PowerApps...Always look to the form first.  It was built for it.

     

    If you have particular areas that are a problem, just post back those issues and I'd be happy to assist.

     

  • skong Profile Picture
    142 on at

    Hi Randy,

     

    Thanks. I going to use Form. I have one question on form, how can I pre-populate a lookup column. In my case, I would like to pre-populate R_Location with value.  Thanks

     

    Stan

  • skong Profile Picture
    142 on at

    Hi Randy,

     

    I get in working with form. And I use this code to pre-populate my R_Location and works.   IN the DefaultSelectedItems

    Filter(Choices([@RCalendar].Location), Value= Gallery7.Selected.R_Location) 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @skong 

    Yes, if you're trying to set the default items in your Combobox from another selection, then your formula is fine.

    Keep in mind that your formula will ALWAYS change the combobox selection to your gallery selection.  If you want to edit an existing record, your existing value will be lost with your formula and it will always use the gallery selection.

    If that is not what you want, then you need to observe the Default property of your datacard (which by default is the underlying record value).  From your control perspective, this can be accessed by Parent.Default.

     

    So, pure guess here because I am not sure of your underlying data type, but the formula would be something like this:

    Coalesce(Parent.Default,
     Filter(Choices([@RCalendar].Location), Value= Gallery7.Selected.R_Location) 
    )

    In this case it will look at the underlying record value first and then use that.  If it is blank (new record), then it will use the gallery selection.  If it is not blank (existing record), then it will use the record value.

  • skong Profile Picture
    142 on at

    Thanks. I just want to set the field to the selected value from the gallery. User are not allowed to change the value of the combo box.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,041

#2
11manish Profile Picture

11manish 676

#3
Valantis Profile Picture

Valantis 655

Last 30 days Overall leaderboard