web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collection LookUp 3 Sh...
Power Apps
Answered

Collection LookUp 3 Sharepoint Lists

(0) ShareShare
ReportReport
Posted on by 55

Good afternoon,

 

I could not find in the forums any solution to fix my problem.
Sorry if it has already been addressed and in that case could you please redirect me to the right topic ?

 

I would like to create a collection that would return the columns from 3 different Sharepoint lists.

The lists' structure is as per below:

t_address

  • id_address
  • ref_stakeholder
  • street1
  • street2
  • ref_city

t_city

  • id_city
  • city_name
  • ref_country

t_country

  • id_country
  • country_name

I would like to create a collection which returns 

  • street1 (from t_address)
  • street2 (from t_address)
  • city_name (from t_city)
  • country_name (from t_country)

To  be noted, that I want a specific line from t_address which is filtered with the value a control named ComboBox6_3 (that returns the stakeholder reference)


So far, I could get a collection street1, street2 and city_name, but when I insert LookUp to get the country, the collection is empty.

Current but non working code : 

ClearCollect(
collect_address;
ForAll(
Filter(t_adresse;ref_stakeholder = ComboBox6_3.Selected.ref_company_defaut);
{
IdAddress : id_address;
Street_1 : street1;
Street_2 : street2;
CityName : LookUp(
t_city;
id_city = ref_city;
city_name
);
CountryName: LookUp(
t_country;
id_country = LookUp(
t_city;
id_city = ref_city;
ref_country
);
country_name
)
}
)
)

Thanks for your help


Categories:
I have the same question (0)
  • QuentinDURIEZ Profile Picture
    577 Moderator on at

    Hi,

    You can do something similar to 

    Collect(collect_address
    	ShowColumns(
    			AddColumns(
    				AddColumns( 
    					Filter(t_adresse;ref_stakeholder = ComboBox6_3.Selected.ref_company_defaut) As address,
    					"city",
    					LookUp(t_city As city, city.id_city = address.ref_city, {name : city.city_name , country_name : LookUp(t_country, id_country = city.ref_country, country_name) })
    				) As address_with_city ,
    				"country_name",
    					address_with_city.country_name
    				"city_name",
    					address_with_city.city.name
    			),
    		"street1", "street2", "city_name", "country_name"
    	)
    )

     

    I wrote it on NotePad so maybe you will get some semantic errors, but the idea should work.

     

    Regards,

     

  • Verified answer
    lagoutten Profile Picture
    55 on at

    @QuentinDURIEZ .

    Thanks for your feedback!

    Shall admit there was an error (a miss shall I say) in my code.
    Code was missing a Value() for the 2nd LookUp and it works working like that too.

    ClearCollect(
    collect_address;
    ForAll(
    Filter(t_adresse;ref_stakeholder = ComboBox6_3.Selected.ref_company_defaut);
    {
    IdAddress : id_address;
    Street_1 : street1;
    Street_2 : street2;
    CityName : LookUp(
    t_city;
    id_city = ref_city;
    city_name
    );
    CountryName: LookUp(
    t_country;
    id_country = Value(
    LookUp(
    t_city;
    id_city = ref_city;
    ref_country
    )
    );
    country_name
    )
    }
    )


    Thanks again.

    Regards

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard