cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Edit button from browse gallery doesn't pass data to edit form

In my timesheet app, I have BrowseGallery2 which displays all time entries (data in TimeEntry excel table). I've added a button to take me back to the EnterWorkTime screen to edit the data in EditForm4. 

The Onselect formula for the edit button is currently:

EditForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None)

I thought I'd put in another argument after the screen transition like TimeEntry.ThisItem to bring the data from the selected BrowseGallery2 but it doesn't like it. 

Suggestions appreciated. Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Edit button from browse gallery doesn't pass data to edit form

Hi @spow5666 ,

Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the button in the BrowseGallery2 to following:

EditForm(EditForm1);
Navigate(EditScreen1)

 

Set the OnSelect property of the ButtonEnterWorkTime to following:

NewForm(EditForm1); // Modify formula here. Make your Editform1 in New Mode
Navigate(EditScreen1)

 

Set the Item property of the Edit form (EditForm1) to following:

If(
   EditForm1.Mode = FormMode.New,
   Defaults(TimeEntry),
   BrowseGallery2.Selected
)

 

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

5 REPLIES 5
Highlighted
Resolver II
Resolver II

Re: Edit button from browse gallery doesn't pass data to edit form

You would have to do it like this. EditForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None, {varTimeEntry: ThisItem.TimeEntry})

 

 

------------------------------------------------------------------------------OfficePowerUser.com------------------------------------------------------------------------ 
If this post helps answer your question, please click on “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up. 

Highlighted
Anonymous
Not applicable

Re: Edit button from browse gallery doesn't pass data to edit form

Hey @spow5666 ,

 

I might be misunderstanding your question, but if it is what I think it is, you may just need to adjust the 'Item' field on your form.

 

Change the 'Item' field on your form to BrowseGallery2.Selected  and the form should start pulling the info you selected.

 

Hope that helps!

Highlighted
Frequent Visitor

Re: Edit button from browse gallery doesn't pass data to edit form

@Anonymous thanks for your suggestion.

That works when navigating from BrowseGallery2 to edit an existing TimeEntry record, however, when I navigate to EditForm1 from a ButtonEnterWorkTime on DetailScreen1 which is used to create a new TimeEntry record, the screen is populated with the record previously navigated from BrowseGallery2. 

How do I then instruct the Item property on EditForm1 to use Defaults(TimeEntry) when navigating from ButtonEnterWorkTime on DetailScreen1 or use BrowseGallery2.Selected  when navigating from BrowseGallery2?

 

 

Highlighted
Advocate I
Advocate I

Re: Edit button from browse gallery doesn't pass data to edit form

Ok so what ever you do, dont parse a variable using the navigate function. It will make your app super slow to switch pages. Better to add a global variable to the top of the code like Set(gblTimeEntry, timeentry.selected) as it will be much faster.
Highlighted
Community Support
Community Support

Re: Edit button from browse gallery doesn't pass data to edit form

Hi @spow5666 ,

Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the button in the BrowseGallery2 to following:

EditForm(EditForm1);
Navigate(EditScreen1)

 

Set the OnSelect property of the ButtonEnterWorkTime to following:

NewForm(EditForm1); // Modify formula here. Make your Editform1 in New Mode
Navigate(EditScreen1)

 

Set the Item property of the Edit form (EditForm1) to following:

If(
   EditForm1.Mode = FormMode.New,
   Defaults(TimeEntry),
   BrowseGallery2.Selected
)

 

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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,570)