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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add columns in collection
Power Apps
Answered

Add columns in collection

(0) ShareShare
ReportReport
Posted on by 337

I have created collection and adding data from HEADER_TABLE.

I am trying to add 2 columns in table , here is my code

ClearCollect(colHeaderDetails, AddColumns(HEADER_TABLE, "IsChosen", false, "DateAsNumber",
Year(CREATED_DATE) * 10000 + Month(CREATED_DATE) * 100 + Day(CREATED_DATE)));

 

when i am adding only "IsChosen" column then it's working fine but, when i am trying to add "DateAsNumber" with calculated value then in collection values are showing only for CREATED_DATE and DateAsNumber columns, rest of the columns data is blank.

 

What i am doing wrong here?collection.PNG

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,119 Most Valuable Professional on at

    Hi @VD ,

    I am not sure how this helps, but I just ran this on a test list

    AddColumns2C.png

    and received all the fields in the list plus the two added. EndDate is a SharePoint Date field (date only).

    AddColumns2.png

    Can you see anything you are doing differently?

     

    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.

     

     

  • VDI Profile Picture
    337 on at

    Hi @WarrenBelz ,

    I can't see any difference. I am facing this issue for all the table that i want to add in collection with Date as number column.

    Even i create new app and tried with same code, but no luck.

  • WarrenBelz Profile Picture
    156,119 Most Valuable Professional on at

    @VD 

    The only difference I can see is that yours is a Date/Time field. I just tested that as well here and received all the fields, however there is one question I have not asked - what is your data source type? If it is Excel, its treatment of dates is often problematic - can you please confirm this.

     

    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.

  • VDI Profile Picture
    337 on at

    @WarrenBelz , data source i'm using is Azure SQL.

  • WarrenBelz Profile Picture
    156,119 Most Valuable Professional on at

    Thanks @VD ,

    That does not explain the issue then. My example was in SharePoint, but there is no reason it should not work in Azure. I will tag @RandyHayes to see if he has some idea.

  • VDI Profile Picture
    337 on at

    @WarrenBelz , Thanks for help and tagging @RandyHayes .

    It was working till yesterday, but now when i'm trying, it's giving me this issue.

  • VDI Profile Picture
    337 on at

    @WarrenBelz , I forgot to mentioned, I am creating collection on App OnStart  and not on Button Click.

  • WarrenBelz Profile Picture
    156,119 Most Valuable Professional on at

    @VD ,

    It still should work  - the data source is connected and nothing in there refers to any controls where the value may not have yet resolved.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @VD 

    Try to turn off the Explicit Column Selection option in your app settings.  Also turn off the Use non-blocking OnStart rule.

    See if that makes any difference for you.

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @VD 

    Oh forgot to mention...Azure SQL supports Explicit column selections, so that option does apply.  However, when you add columns to a datasource like that, PowerApps will consider that it doesn't need to get anything but what you need.

    In your case, you are "demanding" CREATED_DATE only in the formula.  So, your end result is that you demanded nothing else, so you get nothing else.  This is why you see that column with values and then also the columns you added...and nothing else.

     

    This is actually a great feature and a HUGE performance boost for SQL based apps.  But, if you're using collection for some reason, then this will not work as you will see results like this.

    If you were to have used the formula on something beside a collection, you would have seen all the results needed.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard