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

"No item to display" after SubmitForm

Hi,


I have the following setup.

 

1.  Page with a gallery control that lists all contacts

2.  Page with Display Form (has new icon and edit icon)

3.  Page with Edit Form (has cancel icon and submit icon)

 

Data is in a sharepoint list.

 

User clicks a contact from the gallery and is taking to the view contact page.  From there user can click edit icon.  Which loads the edit form and prepopulates data.  Everything works as expected up to this point.  Once I make changes and press the submit button, the Dispaly form shows again.  However it doesn't show the contact instead it displays "No item to display" message.  The changes I make are saved.  The only way to get data back is to go back to the first page (list of contacts and select a contact).

 

Code:

  • When user clicks submit the following is executed:  OnSubmit (of the icon) - SubmitForm(EditContact)
  • If the submit is successful, the following is also executed:  OnSuccess (of the edit form)ResetForm(EditContact);Back()
  • Code to get to the edit form is: OnSubmit (of edit icon)EditForm(EditContact);Navigate(AddContact, ScreenTransition.None)

I've tried everything I can think of without success.  Any help would be appreciated.


Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
KroonOfficeSol
Level 10

Re: "No item to display" after SubmitForm

You could also skip the viewscreen and only keep the edit screen. Set the form here to view and connect it to the gallery (or the lookup, I myself prefer this method). Then the submitform(), newform() formulas will set the state and after submitting it will go back to view.

Introducing a variable will also mean you can set the variable to the new id on the onsuccessfull property off the form.

Hope this helps to.

Paul

View solution in original post

7 REPLIES 7
Super User
Super User

Re: "No item to display" after SubmitForm

Hi @kddesai,

The only issue I see that could potentially be a problem is the ResetForm() function in the OnSuccess property of the Edit form. I don't think it is necessary. 

ResetForm(EditContact);Back()

On my side I created a new app from a Sharepoint list and it did not have that command in the OnSuccess property.  However, if I put it in, I still could not reproduce your issue. In any event, I recommend taking it out as it doesn't add anything.  Also, try instead of Back() in the OnSuccess property of your form, put Navigate(BrowseScreen1,None), assuming BrowseScreen1 is the screen that the Gallery is on.  One other issue would be to check the Items property of the Gallery and make sure that it is the same as the Datasource property of both Forms and that the Item property of the form references the selected record in the gallery.  ie. Gallery1.Selected.

KroonOfficeSol
Level 10

Re: "No item to display" after SubmitForm

Could it be your datasource is refreshed and so the gallery has no record selected? You could check this by adding a label and put gallery.selected.title in the text property.

If it's empty this is your problem. You could then maybe pass a varible in the navigate formula holding the id off the record and do a lookup on your form.item.

Paul
kddesai
Level: Powered On

Re: "No item to display" after SubmitForm

Thank you for the feedback.  I agree with your suggestion on ResetForm.  I took it out but makes no difference.  I am not able to reproduce this issue in other apps I am generating either. I have double checked Items property and that does  not seem to resolve the issue.  I changed the Back() to Navigate as you suggested but that did not resolve the issue.  I will play around with this a bit more to see what the issue could be. 

kddesai
Level: Powered On

Re: "No item to display" after SubmitForm

@KroonOfficeSolyou seem to have hit on the issue.  The title is empty.  I am going to try your solution and will report back.  Any idea why or how the datasource may be refreshing?  This typically does not happen.  

KroonOfficeSol
Level 10

Re: "No item to display" after SubmitForm

You could also skip the viewscreen and only keep the edit screen. Set the form here to view and connect it to the gallery (or the lookup, I myself prefer this method). Then the submitform(), newform() formulas will set the state and after submitting it will go back to view.

Introducing a variable will also mean you can set the variable to the new id on the onsuccessfull property off the form.

Hope this helps to.

Paul

View solution in original post

kddesai
Level: Powered On

Re: "No item to display" after SubmitForm

@KroonOfficeSoltried the lookup and it works.  So, the only question is why the datasource is getting refreshed.  Thank you for pointing me in the right direction.  Will continue looking into this.

kddesai
Level: Powered On

Re: "No item to display" after SubmitForm

Deleted the screens and recreated them from scratch.  Resolved the issue.  @KroonOfficeSol I like your solution and will utilize that going forward.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,586)