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

Merge 2 Galleries

Hi,

 

I have 2 separate SharePoint lists displayed in 2 separate galleries in my power app. I would like to display one of the columns into the other gallery based on the condition that the title field matches.

 

To put more detail in, I would like the calculated column values (highlighted in green) to appear in the top gallery, IF the title matches (highlighted in yellow)

powerapps.png

 

 

Any help and advice is greatly appreciated. 

 

Thank you

 

Nathan

7 REPLIES 7
Super User III
Super User III

Hi @NathanMowat ,

You have not provided any field or table name here, but you need the AddColumns() function.

Your gallery Items would be something like

AddColumns(
   YourList2Name,
   LookUp(
      YourList1Name,'
      YourNameColumn1=YourNameColumn2
   ).YourNumberColumn
)

Note - the two Name column titles should be different (don't name then the same).

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @WarrenBelz,

 

Thank you for your help so far, I really appreciate it. I've attached the screen shot again with the column names to give some more detail.

 

The top list is named 'Total Holiday'

The list below is called 'Leave Request'

 

As you can see, the name column in 'Total Holiday' is called 'Name' and the name column in 'Leave Request' is called Title. 

 

The column in green (the one I'd like to lookup (if the name column fields match)) is a text label with a formula in it (it isn't a column in the SharePoint list). The green highlighted column has the formula - If(ThisItem.Approve.Value = "Approved", ThisItem.'Return Date' - ThisItem.'Leave Date' + 1, 0).

 

powerapps.3.png

 

I have attempted the function you sent me but I'm still having trouble. With this extra information, is there any more detail you could add to the function you sent?

 

Thank you again.

 

Nathan 

Hi @NathanMowat ,

You cannot look up a calculated label - you need to lookup a field in the list 'Leave Request' and return that value. What field contains the current leave entitlement?

Hi @WarrenBelz,

 

Thank you for the reply. It turns out the label was a column, so I have managed to merge the two lists. However, the value that is returned isn't correct. The name "Nathan Mowat" has taken 12 days holiday, yet in the taken column (in the top table) only shows him taking 2. 

 

The formula used to get this value was = LookUp('Leave Request_1', Title = ThisItem.'Name (Title)', Sum('True days booked'))

The column name 'True days booked' is actually the column named Days in the bottom list. (the column hasn't been renamed however)

 

Any assistance on this would be great. Cheers.
powerapps.4.png

Hi @NathanMowat ,

Can you please supply the actual code (in Text) you are using on the filter and also the correct field names in the list.

Hi @WarrenBelz,

 

Thank you again for your continued support on this, I really appreciate it. 

 

Below is a screenshot of the two lists with their actual column names. It also has the code I am using to lookup the Sum of 'true days booked' column' if the 'title' fields match. 

 

Lookup('Leave Requst_1', Title = ThisItem.Title, Sum('True days booked'))

Powerapps.5.png

 

 

 

 

There are many records in the 'Leave Request 1' that relate to one record in the 'Total Holiday' list. Therefore, maybe it has something to do with many-one-relationships. 

 

The 'True Days Booked' column is a calculated column in the 'Leave Request_1' SharePoint list. It is calculated using the code below. 

 

If(Approve Status = "Approved", Return date - Leave date +1, 0)

 

Hope this helps!!

 

Nathan 

 

Hi @NathanMowat ,

This is now more about data design - you need to populate a field with that formula and then use that in the LookUp.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (32,776)