Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

ClearCollect is not rendering values

(0) ShareShare
ReportReport
Posted on by 228

I have the following code that should be rendering results but it doesn't:

 

ClearCollect(CollectMyRequests,{Value:"All"});Collect(CollectMyRequests,Distinct('ListName',Status.Value))

 

My "Status" column is a Sharepoint Choice column and contains the choices "To Be Started" "In Progress" and "Completed"

 

Any help would be appreciated. I've tried changing Value to Result and still no luck.

 

Thanks in advance.

 

  • ShondaT Profile Picture
    228 on at
    Re: ClearCollect is not rendering values

    Ok. I'll have to figure out the filter thing. Thank you again!

  • WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    Re: ClearCollect is not rendering values

    Hi @ShondaT ,

    Your main issue was you had Value in the "All" part instead of Result. You can actually do without the collection and put this directly into the Items

    Ungroup(
     Table(
     {
     Menu: 
     Table({Result: "All"})
     },
     {
     Menu: 
     Distinct(
     AddColumns(
     ListName,
     "StatValue",
     Status.Value
     ),
     StatValue
     ).Result
     }
     ),
     "Menu"
    )

    Your additional question would require a filter based on the user's name or email, depending what you have in your list.

  • ShondaT Profile Picture
    228 on at
    Re: ClearCollect is not rendering values

    That did it!

    I hate to expand this because the additional thing I'm trying to do is have the list by default display requests where all of the user's requests appear when they land on the screen. I have a Requestor field that is a people and group sharepoint field from Active Directory.

     

    Thank you so much! I am so curious to know why the code I had didn't work since I got it from watching one of Shane's videos from Powerapp911. I'm trying to grasp the whole concept of Collect and Clearcollect and how those work with various field types. 

     

    Thank you so much for helping me get this far WarrenBelz! If you have any thoughts on the above I'd really appreciate the help.

  • Verified answer
    WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    Re: ClearCollect is not rendering values

    Hi @ShondaT ,

    This should work

    ClearCollect(
     CollectMyRequests,
     {Result: "All"},
     Distinct(
     AddColumns(
     ListName,
     "StatValue",
     Status.Value
     ),
     StatValue
     ).Result
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard