cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Edit and Add Form - blank for adding but contents from data source for edit?

Thank you all for answering my totally newbie questions, but I am learning and fast, for a work requirement.  Here is my question:  I have an app that has a screen with an EditForm.  This EditForm is to be used for both adding a new record and editing an existing one to my data source (Excel spreadsheet in this case).  Now, I have broken something (i think this used to work from my original build) and am not sure what.  What happens now is that if you click the button to add a record, you see the Hint contents and all works as expected.  BUT, if you click the pencil to edit an existing record, you get the Edit screen but with the Hint text, not the contents from the existing record.  How can I fix this, pls?  

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I did figure it out - I had blanked out the Default text in an effort to fix something else, and that was causing the problem.  Thanks!

View solution in original post

5 REPLIES 5
mdevaney
Super User
Super User

@Anonymous 

Please share a screenshot of the screen with your edit pencil.

 

Also share this code:

  • Code found in the OnSelect property of the pencil
  • Code found in the Items property of the form.

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

 

Anonymous
Not applicable

PowerApps test.jpg

 

And:

  • Code found in the OnSelect property of the pencil == EditForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None)
  • Code found in the Items property of the form. == BrowseGallery1.Selected

I've checked thru some other guidance and this looks okay, so still not sure what could be wrong!  Thanks!

 

 

@Anonymous 

I am thinking the Gallery record is somehow becoming deselected.  So I will suggest an alternate method of loading the record into our form.

 

Change the OnSelect property of your Gallery to this code

Set(currentRecord, ID = Gallery.Selected.ID)

 

Make the OnSelect property of the pencil this

LookUp(your_datasource_name, ID = currentRecord);

 

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

Anonymous
Not applicable

Thank you - I am still having issues.  The code above, when added to the usual Navigate code, makes the icon that takes you to the next screen no longer function, plus it has an error on the details screen (with the pencil) that the variable is invalid.  How does the Gallery usually get selected?  And what internal to a screen could be deselecting it? I feel like taking this back to the way it should work might solve the issue, but I am too new to this to know what I could've changed to break the original setup.  I do think this worked when I first built the app from the spreadsheet, but I've had to change so many things as I've progressed, I may have broken something in the process but not known I was doing so.

Anonymous
Not applicable

I did figure it out - I had blanked out the Default text in an effort to fix something else, and that was causing the problem.  Thanks!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,580)