cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jlibreros
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
KrishnaV
Super User
Super User

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.

 

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
v-yutliu-msft
Community Support
Community Support

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.

yes, it's my requeriment

Hello,

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

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.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,804)