cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Fill gallery control with data that is storage in two list linking with a looup field

Hello

I wanto to fill gallery control with data that is storage in two list linking with a looup field. I need to use field of two list.

 

Best Regards

6 REPLIES 6
Highlighted
Community Champion
Community Champion

Re: Fill gallery control with data that is storage in two list linking with a looup field

Hi @jlibreros ,

 

Gallary control in Power Apps can accept only one data source as input. May I know what is the business needs to help you better to address your issue. If I understood your requirement you want to show the data from both the list into the Gallery.\

 

Regards,

Krishna
If this post helps, then please consider Accept it as the solution and give thumbs-up to help the other members find it more.

 

 

Highlighted
Community Support
Community Support

Re: Fill gallery control with data that is storage in two list linking with a looup field

Hi @jlibreros ,

Do you want to display fields of two lists in one gallery?

Firstly, please notice that one gallery could only has one data source.

So to get the feather that you want, you need to marge two lists to one table by linking with the lookup column.

I assume that:

1)in list1, you want more fields, lookup field is in this list(named lookupfield)

2)in list2, you want field1, field2, the lookup's related field is field3

Try this formula:

ClearCollect(collection1,
             AddColumns(list1,"field1",LooKUp(list2,field3=lookupfield.Value,field1),
                              "field2",LooKUp(list2,field3=lookupfield.Value,field2)
                        )
               )

 //addcolumns function will evaluate one by one for each column in list1.

 

Then set the gallery's Items to collection1.

 

 

Please replace with the listnames, columnnames.

 

If you still have problems, please show me these two lists' stucture.

 

 

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.
Highlighted
Frequent Visitor

Re: Fill gallery control with data that is storage in two list linking with a looup field

yes, it's my requeriment

Highlighted
Frequent Visitor

Re: Fill gallery control with data that is storage in two list linking with a looup field

Hello,

I use the propose solution, but powerapps show error invalid argument

Highlighted
Community Champion
Community Champion

Re: Fill gallery control with data that is storage in two list linking with a looup field

Hi @jlibreros ,

 

Try the same as below:

ClearCollect(colReservationData
AddColumns(Reservation, 
	"features of objects and spaces of reservation",  
	LookUp( SPlist2, ID = Reservation[@RoomOrMaterial] ) 
))

The syntax you are using for AddColumn is not proper, please find the below MS article with examples on AddColumns:
 https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping

I hope this resolved your issue if you see any challenge let me know I am always happy to help.

 

Regards,

Krishna
If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

Highlighted
Community Support
Community Support

Re: Fill gallery control with data that is storage in two list linking with a looup field

Hi @jlibreros ,

1)Please tell me the data type of RoomOrMaterial.

If you compare ID and RoomOrMaterial, these two fields should be the same data type.

Obviously, these two are different data type, so you will have that kind of error.

2)Please notice my suggestion formula:

LooKUp(list2,field3=lookupfield.Value,field1)

It seems that you forgot the last part.

 

Try this formula:

ClearCollect(colReservationData,
             AddColumns(Reservation,"features of objects and spaces of reservation",LooKUp('features of objects and spaces of reservation',ID=RoomOrMaterial.Id,field1),
                             
                        )
               )
//please replace field1 with the field value that you want in 'features of objects and spaces of reservation'

 

 

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.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,179)