cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wendy01
Frequent Visitor

Update sharepoint list by eidt form

hello all, 

I am struggling with edit form. Here is the senario:

I  have a sharepoint list to log staff learning status. I create an edit form to edit and view user information. I want user to update the selected user's information, but if I user submitform() function, it add a new record instead of updating original record. 

Another issue is : I hope when users update information , they input limited content. For Example: for Shift, user can only input dayshif/nightshif. I did't figure out.  thanks  in advance. 

@Shanescows 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Wendy01 ,

Q1:

The reason why you can not edit an existing record, not create a new record is because of the form's displaymode.

If the form's mode is new, the form will be used to create new record.

If the form's mode is edit, the form will be used to edit an existing record.

How to set?

In gallery screen, set the navigate button1's OnSelect( to  edit an existing record):

EditForm(Form1);Navigate(Form1screen)
//please replace with your form name and screen name

set the navigate button2's OnSelect( to  create a new record):

 

NewForm(Form1);Navigate(Form1screen)
//please replace with your form name and screen name

 

In edit form, set the form's data source to the same data source, Item to : 

Gallery1.Selected

//please replace with your gallery name

Here's a doc about form's mode for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail

 

Q2:

I agree with @BrianS . I suggest you use drop down to update and display Shift column.

Could you tell me the data type of Shift column?

I assume that it is text type.

Then please set like this:

1)set the drop down's Items:

["dayshif","nightshif"]

2)set the drop down's Default:

ThisItem.Shift 

 3)set this field's datacard Update:

DropDown1.Selected.Value
//please replace with your drop down name

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Wendy01
Frequent Visitor

Here is the screenshot. hope it help you to get what I am talking.

forms.jpg

 

BrianS
Super User
Super User

For the shift issue - just make that input a dropdown, put the possible answers in the dropdown Item property.

For the other issue we would need to know more about the app - how are you selecting which record to edit?

Wendy01
Frequent Visitor

 

Thank you Brian!I think dropdown is good when create a new record but not this view-edit. If I set it as dropdown(custome), in view mode it doesn't show selected users information. 

 

For the other issue we would need to know more about the app - how are you selecting which record to edit?

I have a gallery , the edit form item is from gallery. selected

Hi @Wendy01 ,

Q1:

The reason why you can not edit an existing record, not create a new record is because of the form's displaymode.

If the form's mode is new, the form will be used to create new record.

If the form's mode is edit, the form will be used to edit an existing record.

How to set?

In gallery screen, set the navigate button1's OnSelect( to  edit an existing record):

EditForm(Form1);Navigate(Form1screen)
//please replace with your form name and screen name

set the navigate button2's OnSelect( to  create a new record):

 

NewForm(Form1);Navigate(Form1screen)
//please replace with your form name and screen name

 

In edit form, set the form's data source to the same data source, Item to : 

Gallery1.Selected

//please replace with your gallery name

Here's a doc about form's mode for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail

 

Q2:

I agree with @BrianS . I suggest you use drop down to update and display Shift column.

Could you tell me the data type of Shift column?

I assume that it is text type.

Then please set like this:

1)set the drop down's Items:

["dayshif","nightshif"]

2)set the drop down's Default:

ThisItem.Shift 

 3)set this field's datacard Update:

DropDown1.Selected.Value
//please replace with your drop down name

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

thank you for your detailed input. 

The issue is not can't eidt the existing record. The problem is when I edit the existing record, I add a new items. That's not what I want. let's one record is Wendy, and her shift was nightshift, but now she change her shift to dayshift. I want update her shift in edit form from nightshift to dayshift. If use editform() and submitform(), it will create a new item named Wendy with dayshift in sharepoint. What I want to do is change the exsiting record shift from nightshift to dayshift

 

I totally agree with you that dropdown is a good way to limit user input. 

set the drop down's Default to ThisItem.**bleep**  May solve my problem. I will try and give fedback . 

 

Hi @Wendy01 ,

Have you change the form's mode to edit?

EditForm() function is used to change the form's mode.

If one form's mode is edit , it will not create a new record.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

yeah, you're right.If one form's mode is edit , it will not create a new record. My fault. I tested and it worked as expected. Thank you very much .

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,182)