cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mfialek Helper I
Helper I

Gallery calls a different list in Sharepoint for details and edit

Can I gallery call a different sharepoint list in order to get the detail of that record?  We have a "holding" list and that is the datasource for a gallery but the detail of that record is in another table.  If possible, what is the syntax?   I tried lookup and if but I haven't been able to retrieve the records.  

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Gallery calls a different list in Sharepoint for details and edit

Hi @mfialek ,

Could you please share a bit more about your scenario?

Do you want to display "holding" list records and Details records within a single one Gallery, and want to edit these details info?

 

Based on the needs that you mentioned, I think the AddColumns function could achieve your needs. I assume that there is a relationship (One to One) between your "holding" list and the Details List.

 

I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Gallery to following:

AddColumns(
           'holding List',
           "DetailRecordID",   // retrieve the Item ID value from the "Details" list 
           LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, ID),
           "DetailColumn1",
           LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, DetailColumn1),
           "DetailColumn2",
           LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, DetailColumn2),
           "DetailColumn3",
           LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, DetailColumn3),
           "DetailColumn4",
            LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, DetailColumn4),
            ....
            ....
)

Note: The LookUpColumn represents the LookUp type column in your Details List, which references the values from the ReferencedColumnInHoldingList column in your "holding" list.

Then within your Gallery, add several Text Input box (Column1TextBox, Column2TextBox, Column3TextBox, ...) to display values from above result, set the Default property of the Text Input box to following:

ThisItem.DetailColumn1
ThisItem.DetailColumn2
ThisItem.DetailColumn3

...

Note: The DetailColumn1, DetailColumn2, DetailColumn3, ... are all columns in your "Details" List

 

Then add a "Save" button/icon within your Gallery, set the OnSelect property of the "Save" button to following:

// Edit an existing record in your Details List
Patch(
      'Details List',
      LookUp('Details List', ID = ThisItem.DetailRecordID),
      {
          DetailColumn1: Column1TextBox.Text,
          DetailColumn2: Column2TextBox.Text,
          DetailColumn3: Column3TextBox.Text,
          ...
      }
);
If(
   IsEmpty(Errors('Details List')),
   Notify("Update Successfully!", NotificationType.Success);Refresh('Details List');Refresh('holding List')
)

 

More details about the Patch function in PowerApps, please check the following article:

Patch function

 

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

1 REPLY 1
Community Support
Community Support

Re: Gallery calls a different list in Sharepoint for details and edit

Hi @mfialek ,

Could you please share a bit more about your scenario?

Do you want to display "holding" list records and Details records within a single one Gallery, and want to edit these details info?

 

Based on the needs that you mentioned, I think the AddColumns function could achieve your needs. I assume that there is a relationship (One to One) between your "holding" list and the Details List.

 

I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Gallery to following:

AddColumns(
           'holding List',
           "DetailRecordID",   // retrieve the Item ID value from the "Details" list 
           LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, ID),
           "DetailColumn1",
           LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, DetailColumn1),
           "DetailColumn2",
           LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, DetailColumn2),
           "DetailColumn3",
           LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, DetailColumn3),
           "DetailColumn4",
            LookUp('Details List', LookUpColumn.Value = ReferencedColumnInHoldingList, DetailColumn4),
            ....
            ....
)

Note: The LookUpColumn represents the LookUp type column in your Details List, which references the values from the ReferencedColumnInHoldingList column in your "holding" list.

Then within your Gallery, add several Text Input box (Column1TextBox, Column2TextBox, Column3TextBox, ...) to display values from above result, set the Default property of the Text Input box to following:

ThisItem.DetailColumn1
ThisItem.DetailColumn2
ThisItem.DetailColumn3

...

Note: The DetailColumn1, DetailColumn2, DetailColumn3, ... are all columns in your "Details" List

 

Then add a "Save" button/icon within your Gallery, set the OnSelect property of the "Save" button to following:

// Edit an existing record in your Details List
Patch(
      'Details List',
      LookUp('Details List', ID = ThisItem.DetailRecordID),
      {
          DetailColumn1: Column1TextBox.Text,
          DetailColumn2: Column2TextBox.Text,
          DetailColumn3: Column3TextBox.Text,
          ...
      }
);
If(
   IsEmpty(Errors('Details List')),
   Notify("Update Successfully!", NotificationType.Success);Refresh('Details List');Refresh('holding List')
)

 

More details about the Patch function in PowerApps, please check the following article:

Patch function

 

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,186)