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

Community site session details

Session Id : VWGXLcUOTMZDIKnzbd1srV
Power Apps - Building Power Apps
Unanswered

Simple Newbie Question about the Edit Form

Like (0) ShareShare
ReportReport
Posted on 26 May 2023 14:16:20 by 669

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!

I have the same question (0)
  • mmollet Profile Picture
    3,187 on 26 May 2023 at 14:25:41
    Re: Simple Newbie Question about the Edit Form

    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
    669 on 26 May 2023 at 17:01:41
    Re: Simple Newbie Question about the Edit Form

    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
    669 on 26 May 2023 at 20:14:14
    Re: Simple Newbie Question about the Edit Form

    @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
    669 on 26 May 2023 at 20:17:44
    Re: Simple Newbie Question about the Edit Form

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard
Loading complete