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!

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!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,659)