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

Join two Sharepoint Lists and get max value

Hi,

 

I have 2 SharePoint Lists.

 

List n°1 contains countries :

 

countries.JPG

 

List n°2 contains travels :

 

travels.JPG

 

To join the lists, list1.ID=list2.ID_country

I need to display the countries, in a gallery, and add a column with last date of travelling for each country.

join.png

Country needs to be display even if no travels exists for this ID.

 

Have any king of ideas ?

 

Regards

 

1 REPLY 1
Highlighted
Super User
Super User

Re: Join two Sharepoint Lists and get max value

@manu59 

I suggest you create a collection but putting this code into the OnVisible property of the screen or the OnSelect property of a button.

 

ClearCollect(
    myMaxDates,
    AddColumns(
        List1,
        "Max Travel",
        LookUp(
            Sort(List2, 'Travel date', Descending),
            ID_country = List1[@ID]
            'Travel date'
        )
    )
)

 

Then you can place the collection into the Items property of a gallery or data table by simply referencing it like this

myMaxDates

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

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