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 / Simple Newbie Question...
Power Apps
Unanswered

Simple Newbie Question about the Edit Form

(0) ShareShare
ReportReport
Posted on by 697

Hello,

So I have this one week calendar that connects to Share Point as a data source. I've been manually putting in example data in the SP to test, but now I want to be able both Add and Edit the events in Powerapps, and this seems simple but I've never done this before...

 

I am assuming I Insert the "Edit Form", and I am assuming that the Default Mode should be "Edit" for Editing, and New for a New, so I would essentially need 2 different forms, yes?

More importantly, I see no "Submit" button, do I have to make this on my own? What would I have to put on the Onselect to make it update or add the data into Sharepoint?

 

Any help is appreciated!

Categories:
I have the same question (0)
  • mmollet Profile Picture
    3,187 on at

    So you can use the same form or you can use two forms either way is up to you. The way to use 2 forms is their property called FormMode into a variable/if statement that you then use to switch it to the proper mode that you need. 

     

    To submit a form to SP you use the SubmitForm() function and then pass in the form name. Here is some example code on how you can do this. I am going to assume that you are selecting an item from a gallery on "Screen1" and that you also have a New Item button on "Screen 1" as well. 

     

    // when the user clicks an item in the form we want to save it to a variable and send it to the form screen when we go

    Gallery.OnSelect -> Navigate(FormScreen, ScreenTransition.None, {selectedItem: ThisItem})

     

    // when the user wants to make a new item we want to send the same variable but make it blank this time

    NewButton.OnSelect -> Navigate(FormScreen, ScreenTransition.None, {selectedItem: Blank()})

     

    // Now for your FormName.FormMode you will want to decide which form type to show based on the above code

    Form.FormMode -> If(IsBlank(selectedItem), FormMode.New, FormMode.Edit)

     

    // Dont forget to tell the form which item to show when in edit mode!

    Form.Item -> If(IsBlank(selectedItem), Blank(), selectedItem)

     

    Hope this helps and makes sense for you! Ask any question you have!

  • CharlesBrewer Profile Picture
    697 on at

    Hey @mmollet ,

    A little confusing, but perhaps I should have put more info. They won't be selecting single items. Think of it as an entry, with all the items showing. Let me try some pictures, here is what I have currently (WIP). 
    This is my calendar, and you see the little calendar icon on each date, I want them to be able to click on it and it open a popup to add a new entry :

    CharlesBrewer_0-1685120269057.png

    CharlesBrewer_1-1685120312433.png

    Then I of course need a Submit button there to submit the whole thing and add it to the Sharepoint list.

    Then I also need the same thing, but Edit, where if they click on one of the calendar events, it opens up the same kind of window with the data filled in, and they can edit and submit the new info. I should mention that where the date numbers are (21, 22, etc) and the calendar is one Gallery (Gallery2), and if it matters, the events are in a nested gallery (gallery6 within gallery2)

  • CharlesBrewer Profile Picture
    697 on at

    @mmollet 
    So I made a submit button, and I am getting an error, not sure if I did this wrong. (Or rather I did, but what I did wrong)

    CharlesBrewer_0-1685132031541.png

     

  • CharlesBrewer Profile Picture
    697 on at

    Nevermind, I didn't fill in the "email" field which on SP I have looking for an email. Yay working. I'll have to work on the editing part 😕

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard