cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zeuslyone
Microsoft
Microsoft

Navigating to form from data tables (one form to view/edit multiple tables)

Hello,

 

I can't figure out how to solve this problem: I want multiple data tables (all pulling from the same SharePoint list source) to all navigate to one view/edit form that will populate based on clicking a hyperlinked "Title" column in any of those data tables.

 

It works for one data table, but when clicking through on the others, they don't populate the selected item, rather a totally different item.

 

Here's the formula for the data in the table that works:

SortByColumns(AddColumns('CP M365 Projects Q2', "Source", 'Source Quarter'.Value, "CP-PM", 'Assigned PM'.DisplayName), Sortfield, If(SortDirection, Descending, Ascending))

 

Here's the formula for one of the tables that doesn't:
 Sort(Search(AddColumns('CP M365 Projects Q2', "Source", 'Source Quarter'.Value, "CP-PM", 'Assigned PM'.DisplayName), "Q3", "TargetQuarter"),Rank, Ascending)

 

They both navigate with the same hyperlink-enabled formula:

Navigate(DetailView)

 

And that page pulls from the same data source, like I said: 'CP M365 Projects Q2'.

How does one approach this? I was trying to update a variable to the last item clicked and then have that set to load in the form when landing, but I couldn't figure out how to do that, or if that's even the right approach.

Any help would be greatly appreciated.

 

Thanks!

Z

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you, @v-yutliu-msft . That helped point me in the right direction, but it wasn't quite all the way there. I'll explain the next step to help anyone else looking at this thread.

I am/was using Data Tables instead of Gallery, but the approach is more or less the same. The piece that I was missing that was filled in by your response was that I need to edit the "Item" field on the screen with the form (I actually have a view form screen which has a button to connect to an edit screen, so this has to be done for both). Your answer also didn't really address how I have multiple tables navigate to the same form and have it update for the last table interacted with. Here's how you can handle both.

 

1) set a variable on the "OnVisible" for each of the screens with data tables that you want to populate into the edit form. I set it to a different number for each table, so: "Set(tablesource, 1)" on one screen, "Set(tablesource, 2)" on the next table screen, for example Note: I have the column where the rows are that I want to click on (Title in this case) with a Navigate formula that points to the form screen, and that Title field is set to hyperlink on. You click on the hyperlink to be navigated through.

 

2) set the item field on the form detail item (in my case both for the view and edit screens) to:
LookUp('CP M365 Projects Q2', If(tablesource = 1, Title=DataTable1.Selected.Title, tablesource = 2, Title=DataTable1_4.Selected.Title, tablesource = 3, Title=DataTable1_8.Selected.Title, tablesource = 4, Title=DataTable1_7.Selected.Title)) Note: you need that "Title =…", because my column where the selection is made is called "Title", in the lookup, otherwise it fails. Also, for clarity, the different data tables listed are the names of each that are in each of the screens where you set the variables.

Hope this helps some other folks out there!
Thanks again,
Z

View solution in original post

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

Hi @zeuslyone ,

Do you want to display multiple records in one place and click a button, it will navigate to the edit form, edit form will display the item that you selected in the first screen?

If so, I think what you are talking about is the combination gallery and edit form.

Set the gallery's Items to table that you want to display, for example:

SortByColumns(AddColumns('CP M365 Projects Q2', "Source", 'Source Quarter'.Value, "CP-PM", 'Assigned PM'.DisplayName), Sortfield, If(SortDirection, Descending, Ascending))

Set the arrow button's OnSelect (inside the gallery 😞

Navigate(editscreen)

Set the edit form's data source to the same table, for example: 

'CP M365 Projects Q2'

set the edit form's Item: 

Gallery1.Selected

Then the edit form will display the item that you selected in the gallery.

Here's a doc about this kind of app in details for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-forms

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, @v-yutliu-msft . That helped point me in the right direction, but it wasn't quite all the way there. I'll explain the next step to help anyone else looking at this thread.

I am/was using Data Tables instead of Gallery, but the approach is more or less the same. The piece that I was missing that was filled in by your response was that I need to edit the "Item" field on the screen with the form (I actually have a view form screen which has a button to connect to an edit screen, so this has to be done for both). Your answer also didn't really address how I have multiple tables navigate to the same form and have it update for the last table interacted with. Here's how you can handle both.

 

1) set a variable on the "OnVisible" for each of the screens with data tables that you want to populate into the edit form. I set it to a different number for each table, so: "Set(tablesource, 1)" on one screen, "Set(tablesource, 2)" on the next table screen, for example Note: I have the column where the rows are that I want to click on (Title in this case) with a Navigate formula that points to the form screen, and that Title field is set to hyperlink on. You click on the hyperlink to be navigated through.

 

2) set the item field on the form detail item (in my case both for the view and edit screens) to:
LookUp('CP M365 Projects Q2', If(tablesource = 1, Title=DataTable1.Selected.Title, tablesource = 2, Title=DataTable1_4.Selected.Title, tablesource = 3, Title=DataTable1_8.Selected.Title, tablesource = 4, Title=DataTable1_7.Selected.Title)) Note: you need that "Title =…", because my column where the selection is made is called "Title", in the lookup, otherwise it fails. Also, for clarity, the different data tables listed are the names of each that are in each of the screens where you set the variables.

Hope this helps some other folks out there!
Thanks again,
Z

Helpful resources

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

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,746)