cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ogun_ustun
Helper III
Helper III

Update screen & Submit Your "Update"Button

Dear All,

 

I am working on a powerapps customs forms beloning to a sharepoint list. Idea is simple; users create their initiatives and submit the sharepoint list and in case there is update needed on the list item, user will update existing one and submit again.

 

Main Page as following:

- Submit New Initiative

- Edit in existing initiative

 

There is no issue submitting new date but for editing or updating the existing ones i have issue.

> is not working. Which formula should i use to see existing items and update them?

 

Sorry i am pretty new on powerapps i tried to reseach the issue on the form but didn't manage to sort it out.

 

If you support me i will be glad.

 

Thanks

 

Ogun

 

2019-12-15 12_19_37-Untitled - Message (HTML).png2019-12-15 12_21_14-LCIP - Saved (Unpublished) - Power Apps.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Ogun_ustun ,

I have made a test on my side, please consider take a try with the following workaround:

Set the the OnSelect property of the "Add new initiative" button to following:

NewForm(SubmitForm);
Navigate(SubmitScreen)

 

Set the Item property of the SubmitForm to following:

Gallery1.Selected

Set the DefaultMode property of the SubmitForm to following:

FormMode.Edit

 

Please consider take a  try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

6 REPLIES 6
mdevaney
Super User
Super User

@Ogun_ustun 

Here's what I would recommend:

 

Leave this code in place in your Icon's OnSelect property

Select(Parent)

 

Put this code in the OnSelect property of your DataCard

EditForm(your_form_name);Navigate(your_screen_name,None);

 

Finally, use this code in the Item property of your Form.  Make sure you change Gallery1 to match your gallery name on the previous screen.

Gallery1.Selected

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@mdevaneythank for you reply.

 

I did what you recommended to me but didn't manage to make it worked. Screenshots are as following:

 

I have only one form into "Submit Screen" as "Submit From". I don't have a form into Edit Screen. Isn't it correct approach to the app?

 

If you review and support me i will be glad.

 

Thanks

 

Ogun

 

2019-12-15 20_56_50-LCIP - Saved (Unpublished) - Power Apps.png2019-12-15 20_58_01-LCIP - Saved (Unpublished) - Power Apps.png2019-12-15 21_00_32-RE_ mdevaney mentioned you in Power Platform Community - Message (HTML).png

@Ogun_ustun 

Please try this code and let me know if it works.

EditForm(SubmitForm);Navigate(EditScreen);

 

The best practice in PowerApps is to use a single form to New Entry, Edit Existing, or View.  You can control what mode the form is in using:

 

  • NewForm(your_form_name)
  • EditForm(your_form_name)
  • ViewForm(your_form_name)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @Ogun_ustun ,

Does the Gallery1 connect to same data source as your SubmitForm?

Could you please show more details about the error message when you submit form data to update existing record?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please consider set the OnSelect property of the ">" icon in your Gallery to following:

EditForm(SubmitForm);
Navigate(SubmitScreen)

 

Set the Item property of the SubmitForm to following:

Gallery1.Selected

or

LookUp('YourSPList', ID = Gallery1.Selected.ID)

 

Set the OnSelect property of the "Save" button to following (submit form data using Patch function instead of SubmitForm function) :

If(
   SubmitForm.Mode = FormMode.New,
   Patch('YourSPList', Defaults('YourSPList'), SubmitForm.Updates),  // Add new record 
   Patch(                                                            // Update existing record
          'YourSPList',
          LookUp('YourSPList', ID = Gallery1.Selected.ID),
          SubmitForm.Updates
   )
);
If(
   IsEmpty(Errors('YourSPList')),
   Refresh('YourSPList');Back()
)

Please consider take a try with above solution, check if the issue is solved.

Note: I assume that the Gallery1 and the SubmitForm connect to same data source -- 'YourSPList'.

 

More details about Patch function in PowerApps, please check the following article:

Patch function

 

If the issue still exists, please consider re-create a new connection to your SP List from your app, then try above formula again, check if the issue is fixed.

 

Best regards,

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

@v-xida-msftthanks for your reply.

 

Your advise almost found a solution for me but one thing needs to be done:

 

When i click "add new initiative" the cells should come as empty instead of referring existing records? What should i do for it?

 

If you review the screenshots and let me know i will be glad.

BR

 

Ogun

 

2019-12-20 17_59_54-LCIP - Power Apps.png

2019-12-20 18_03_21-LCIP - Power Apps.png

Hi @Ogun_ustun ,

I have made a test on my side, please consider take a try with the following workaround:

Set the the OnSelect property of the "Add new initiative" button to following:

NewForm(SubmitForm);
Navigate(SubmitScreen)

 

Set the Item property of the SubmitForm to following:

Gallery1.Selected

Set the DefaultMode property of the SubmitForm to following:

FormMode.Edit

 

Please consider take a  try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (2,032)