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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ClearCollect Dataverse...
Power Apps
Unanswered

ClearCollect Dataverse Table - LookUp field empty?

(2) ShareShare
ReportReport
Posted on by 482

Hey there

 

I hope someone could help me with the following issue. This is my setup:

 

Table Users

  • Default Users table from Dataverse, including all users in the tenant

Table Schools

  • Users - type: Lookup to Users (internal name: crc06_User)
  • Date - type: date (internal name: crc06_date)
  • some other fields...

If I would like to add the table Schools into a collection, the field crc06_User (which should contain the unique id of linked User) is empty. I realized this always happens with LookUp fields:

schools-test.png

 

 

With ForAll() I could loop through each item to get the unique identifier of the User field. However, combined with a Filter on the data source, I get a "Invalid argument type" error. If I use As for the data source, the error disappears, but so does the unique identifier for the User field again... making LookUp invalid.

schools-test2.png

 

Anyone knows how to get around that issue?

Thank you and kind regards,

 

I have the same question (0)
  • Verified answer
    Prakash4691 Profile Picture
    1,332 on at
    Re: ClearCollect Dataverse Table - LookUp field empty?

    Hi @mrQ ,

    Can you try below formulas,


    Step1,

    Screen->on visible property: Create collect for school entity and get first record of user set to global variable. Just to filter school records based on the userid.

    ClearCollect(TestSchool, Schools); Set(userid, First(Users).User)


    Step2,

    gallery->Items property: filter the collected school record based on the global userid created on above formula.

    Filter(TestSchool, Users.User = userid)

     

    Regards,

    Prakash

  • mrQ Profile Picture
    482 on at
    Re: ClearCollect Dataverse Table - LookUp field empty?

    Hi @Prakash4691 

     

    Unfortunately, this doesn't work since the ClearCollect() won't add the unique identifier of the LookUp field "User" to the collection. Hence, I can't filter based on that field.

     

    Kind regards,

     

  • Prakash4691 Profile Picture
    1,332 on at
    Re: ClearCollect Dataverse Table - LookUp field empty?

    Hi @mrQ ,

     

    But the filtered records for school entity is based on user id.

     

    Regards,

    Prakash

     

     

  • mrQ Profile Picture
    482 on at
    Re: ClearCollect Dataverse Table - LookUp field empty?

    @Prakash4691 

     

    Your second formula:

     

    Filter(TestSchool, Users.User = userid)

     

    will not work like this, since Users.User is not part of the collection TestSchoolUsers is an own entity/table. I assume what you were referring to was the following:

     

    Filter(
     TestSchool,
     User.User = userid
    )

     

    However, I can't filter by the field User in the TestSchool collection, since the User field in that collection is empty.

     

    Kind regards,

     

  • Verified answer
    mrQ Profile Picture
    482 on at
    Re: ClearCollect Dataverse Table - LookUp field empty?

    Hi @Prakash4691 again,

     

    I see what you meant now. I found this blog post explaining the limitation/bug. 

    After your suggestion, I would need to create the collection again with ClearCollect(). Since I set the temp variable before, it will now populate the User.User value into the corresponding User field. 

     

    Thanks for the hint!

  • Prakash4691 Profile Picture
    1,332 on at
    Re: ClearCollect Dataverse Table - LookUp field empty?

    Hi @mrQ ,

     

    Yes, it is a bug.

    I just gave you a hint to achieve solution to your problem.

    Thanks for accepting as the solution.

     

    Regards,

    Prakash

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard