cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
spow5666
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

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
Resolver II
Resolver II

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. 

Anonymous
Not applicable

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!

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

 

 

Keith-Whatling
Advocate II
Advocate II

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.

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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