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

Collection from table with lookup fields - lookup fields empty

Hi,

I need help loading data into a collection on application start.

The data I need to load come from three tables: a base and two lookup tables.

The base table has two lookup columns from lookup tables.

The base table is named User role, and the lookup tables are Users and Role.

Here are the table schemas (simplified):

User role

  • Users – (Lookup to Users)
  • Role name- (Lookup to Role)

Users:

  • Full Name (Text)
  • Email (Text)
  • Role (Lookup to Roles)

Role:

  • Role Name (Text, primary name column)
  • Role Description (Text)

My collection will have three fields: Full Name, Email, and Role Name.

My code is like

collection_8.png

The collection I created returns the correct number of rows according to the Users and Role tables but all of the rows are empty. 

And then I click into the Rolename(The first column), it returns the items but empty.

collection_10.png

 

The image below is showing what the result we expected

 

collection_9.png

What am I doing wrong?

Thanks for your insight.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

In the collect statement replace 'user roles' with ThisRecord for all three columns.

 

Example:  username: ThisRecord.User.'Full Name'

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Super User
Super User

In the collect statement replace 'user roles' with ThisRecord for all three columns.

 

Example:  username: ThisRecord.User.'Full Name'

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Hi @Jeff_Thorpe,

 

Thanks for your reply!

It returned the right format exactly what I want, but still empty records...

collection_11.png

 

Looks like it returned the correct number and record, but still empty 😢

 

Is there any idea?

 

Thank you again.

Hi @Jeff_Thorpe ,

 

It works!!!!!!!!

The first time still returned empty, after I reopen the app more than 5 times.

It finally appeared!!!! 🎉🎉🎉🎉🎉

 

Thank you so much!

Hi @Jeff_Thorpe ,

 

The method you suggested works! But it worked after I reopened the app lots of time.

And after I change the collection's name, it disappeared again.... and I tried to reopen the app more than 10 times to get it back.....

 

After that collection back, I did not dare to change the name anymore, but when I changed something in my base table, the "User Role" table, it disappeared again..... and haven't been back yet ......

 

Do you have any idea on that?

 

Thanks!

 

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.

Top Solution Authors
Top Kudoed Authors
Users online (96,945)