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 / EditForm - how can I a...
Power Apps
Unanswered

EditForm - how can I add an ID to make reference to an existing entry in Sharepoint list?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all. Again, I would need some help.

 

Situation: I have a form those content stems from a Sharepoint list. Now, I would like to hand over any changes in the form back to the Sharepoint list. According to my understanding, I can use EditForm(MyFormName). However, right now anything is happening when I click on the respective button/icon. By "anything" I mean neither a new entry nor an update in the Sharepoint list is taking place and consequently the user is not referred to the OnSuccess-screen. And: In the editor there is no error popping up.

 

Note that the form's DefaultMode is FormMode.New.

 

Hypothesis: I guess the code is missing the information which entry in the Sharepoint list to update. Is there an easy way to adjust the code? So far I tried different variations of the below (w/o any success):

  • EditForm(MyFormName; LookUp(SharepointList;'Column named Name'=varName) with "varName being a variable which I defined previously using the Set function.

Any suggestions?

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Always use Edit form not new form.

    On DeaultMode you can use variable to set the form mode.

    On your Edit button you can set onClick

    Set(varForm,"Edit")

    ON your New form button you can set

    Set(varForm,"New")

    Form Default Mode

    If(varForm="New",FormMode.New,If(varForm="Edit",FormMode.Edit))

     

    If you have a gallery where you select item to edit. OnClick of the icon

    Set(varForm,"Edit");Set(varItem,ThisItem);Navigate(EditScreen);

     

    Form's Item property:

    If(!IsBlank(varItem),varItem)

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @zmansuri  Thanks for your reply. Sorry if I missing something, but all your suggested changes do not enable me to get the EditForm function running, do they?

     

    In any case I changed the form's default mode to .edit.

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    a.jpg

     

    a2.jpg

     

    a3.jpg

     

    This is how i use single form for add/edit. If you go by this method you don't need to change default mode to variable. You can let it stay FormMode.Edit

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @zmansuri 

    This is what I am currently using. Obviously, this is just a workaround as your method, which I tried to implement in a first place, just gave me the first item of my sharepoint list but not the one related to the selected item. The selected item stems from  a cascading selection process (as shown in my first screenshot). To circumvent this problem, I relied on a unique ID which I have anyways in my sharepoint list. But apprently, this seems to make the EditForm function not (!) to work.

     

    Screenshots: the second one apparently is the first screen in my app. The yellow screen is the second screen in my app being pre-populated according to the selection in the cascading selection process in the first screen. I am not able to hand back the data from the yellow screen to my sharepoint list. Is this due to the fact that I am not using the ID automatically given to each entry in the sharepoint list but a workaround? As outlined above, I was forced to use the workaround as the ThisItem.ID gives always back the first entry in sharepoint list (which is obviously not what I am looking for).

     

    powerapps_second.PNGpowerapps_first.PNG

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard