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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Basic ClearCollect que...
Power Apps
Suggested Answer

Basic ClearCollect question

(1) ShareShare
ReportReport
Posted on by 17
I'm trying to use ClearCollect to create a table with certain columns from a dataverser table. This code formats fine, and I can see the correct data in the RenameColumns and the ShowColumns, but AllProjects says 'cant find any data' .
 
What am I missing?
 
ClearCollect(
AllProjects,
AddColumns(
RenameColumns(
ShowColumns('All Mast Projects',Project),
cred3_project,projectName
),'Project Name',projectName
)
);
Categories:
I have the same question (0)
  • scalca Profile Picture
    243 Moderator on at
    did you execute the code once to collect the data ? 
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at
    hey
     
    can you try the following:
    ClearCollect(
        AllProjects,
        RenameColumns(
            ShowColumns('All Mast Projects', "Project"),
            "Project", "projectName"
        )
    );
    

    or this:
    ClearCollect(
        AllProjects,
        AddColumns(
            RenameColumns(
                ShowColumns('All Mast Projects', "Project"),
                "Project", "Project Name"
            ),
            "cred3_project", "Project Name"
        )
    );
    

    if it helped please mark as verified answer to help others.
     
    thanks
  • LB-30081518-0 Profile Picture
    17 on at
    interestingly, when I opened the app this morning the data is there, so it must be some kind of delay in the processing. 
    Is there a way to force it to update the ClearCollect? I had tried refreshing the table in the data menu, and I'm sure I closed the re-opened the app at the time too. 
  • Suggested answer
    Nandit Profile Picture
    1,568 Moderator on at
     
    Can we just use this - 
     
    ClearCollect(AllProjects,
    RenameColumns(ShowColumns('All Mast Projects',cred3_project,projectName),
    <system name of the column>, 'Project Name'));
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
  • timl Profile Picture
    36,393 Super User 2025 Season 2 on at
    Do you really need to use a collection here? (eg, do you need to carry out any additional client side processing or to use additional functionality that a collection provides?)
     
    If you just set the Items property of a table or gallery to a call to AddColumns, there won't be any delay in the processing and you won't need to write formula to refresh the collection.
    AddColumns(
    RenameColumns(
    ShowColumns('All Mast Projects',Project),
    cred3_project,projectName
    ),'Project Name',projectName
    )
     
  • LB-30081518-0 Profile Picture
    17 on at
    Thanks for all the answers. Is there a way to reply to each one as I can't see a 'reply' link... 
     
    @timl, I need the ClearCollect as I'm combining a few Dataverse tables to make a collection of different projects, each with their own table.
     
    My next challenge is that I have a Project Status column in the Dataverse table, which is a 'Choices' type.
     
    I am having trouble getting the choices value into the table so that I can apply a colour according to the status. The following code works with no errors, but in the column for ProjStatus it says this type of data cannot be displayed (or something to that effect). Any pointers much appreciated!
     
    ClearCollect(
    AllProjects,
    AddColumns(
    RenameColumns(
    ShowColumns(
    'All Mast Projects',
    Project,
    'Project Status'
    ),
    cred3_project,
    projectName,
    cred3_status, // this is a choice column
    ProjStatus
    ),
    'Project Name',
    projectName,
    Type,
    "Mast",
    Status,
    ProjStatus
    )
    );

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard