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 / Collection does not re...
Power Apps
Answered

Collection does not return all column data when not explicitly filtering by value

(0) ShareShare
ReportReport
Posted on by 9

Hi Community, 

 

I have an issue with data values showing correctly after using the Collect function. For background, I have a list of records for a year, when a new year comes there is an icon to add the new year. On select, it brings a dialog asking user to input what year they would like to copy. User inputs the year to copy. What it should do is grab the selected record year records, update with the new year and then add an option with new year to gallery, select the new year, and list of records should appear with the new date. 

 

Adding a new year works great. However. when I select the new year from gallery, it appears to have all the records, except there are field data missing and the start date is not updated to the new year.

 

If I use the below query, it does seem to grab the data, creates a new year but some columns are missing and the Start Date is not updated. 

 

UpdateContext({varYearSelected: cpt_Home_YearDialog_.ValueProvided & "0101"});
Set(
gvarYearCopy,
Value(varYearSelected)
);
ClearCollect(
colYearCopyBase,
Filter(
'[dbo].[Test]',
StartDateInt = gvarYearCopy
));
ClearCollect(
colYearCopy,
DropColumns(
colYearCopyBase,
"StartDateInt"
)
);
UpdateContext({varCopyStatus: "Formatting Data"});
UpdateIf(
colYearCopy,
true,
{
StartDate: DateAdd(
StartDate,
1,
Years
),
UniqueID: Blank()
}
);

UpdateContext({varCopyStatus: "Creating New Year Records"});
Collect(
'[dbo].[Test]',
colYearCopy
);/*
Clear(colYearCopy);
Clear(colYearCopyBase);*/

 

However, when I made a new collection with the value explicitly in the expression, all the data fields render as expected. 

 

ClearCollect(
colTEST,
Filter(
'[dbo].[Test]',
StartDateInt = Value("20200101")
)
);

 

Why does it only return all column values if I set the StartDateInt = to a hard-code value, which is not a feasible option as the year to copy will change regularly. 

 

Appreciate any insights and assistance that can be provided here

Categories:
  • alrezac Profile Picture
    Microsoft Employee on at

    Hi,

     

    Looking through your code it, I would think that this should work. I dont see anything that should be causing the error you are describing. This might be a better question for Microsoft Support. I'll include a link below if you would like to go down this route. Otherwise if any other communities users have any ideas I would encourage them to chime in.

     

    If you would like to create a ticket with Microsoft Customer Support here is a link on how to do so: https://docs.microsoft.com/en-us/power-platform/admin/get-help-support

     

    Regards,

     

    Alex

     

    -------

     

    Community Support Team _ Alex Rezac
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Verified answer
    AJardineD365 Profile Picture
    9 on at

    Looping back on this to close

     

    I was able to resolve the issue by setting the StartDateInt to = Value(gvarYearCopy) .

     

    Ahhh the semantics.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard