cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ogun_ustun
Level: Powered On

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
Community Support Team
Community Support Team

Re: Update screen & Submit Your "Update"Button

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
Highlighted
Super User
Super User

Re: Update screen & Submit Your "Update"Button

@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."

Ogun_ustun
Level: Powered On

Re: Update screen & Submit Your "Update"Button

@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

Super User
Super User

Re: Update screen & Submit Your "Update"Button

@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."

Community Support Team
Community Support Team

Re: Update screen & Submit Your "Update"Button

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.
Ogun_ustun
Level: Powered On

Re: Update screen & Submit Your "Update"Button

@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

Community Support Team
Community Support Team

Re: Update screen & Submit Your "Update"Button

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,472)