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

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

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
datamaster
Level 8

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. 

LeonSig
Level: Powered On

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!

spow5666
Level: Powered On

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

@LeonSig 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?

 

 

Keith-Whatling
Level: Powered On

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

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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