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 / How to get sharepoint ...
Power Apps
Unanswered

How to get sharepoint list items between two date and export the items into excel ?

(0) ShareShare
ReportReport
Posted on by 20

Hi All,

 

I want to get the list items between two date and export those items into excel. It is working fine when I do not use filter condition. But when I use filter then data source is going as null in Power Automation flow.

Here is the code: 

ClearCollect(colSPListItems,ShowColumns(Filter(ListName,

startDate.SelectedDate >= Created And endDate.SelectedDate <= Created),"Title","FirstName","LastName","Status"),
Set(varFileLink,ExportToExcel.Run(JSON(colSPListItems,JSONFormat.IgnoreBinaryData &JSONFormat.IgnoreUnsupportedTypes
)).filelink);Launch(varFileLink));

SKY05_0-1676533090239.png

 

Thanks,

SKY

Categories:
  • WarrenBelz Profile Picture
    156,536 Most Valuable Professional on at

    Hi @SKY05 ,

    You have your Flow command inside the Clear Collect - also instead of the Collection, try this. NOTE: I have only addressed the structure and assumed the Flow and the input are correct

    With(
     {
     wItems:
     ShowColumns(
     Filter(
     ListName,
     startDate.SelectedDate >= Created And 
     endDate.SelectedDate <= Created
     ),
     "Title",
     "FirstName",
     "LastName",
     "Status"
     )
     )
     },
     Set(
     varFileLink,
     ExportToExcel.Run(
     JSON(
     wItems,
     JSONFormat.IgnoreBinaryData & 
     JSONFormat.IgnoreUnsupportedTypes
     )
     ).filelink
     )
    );
    Launch(varFileLink);

     

    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

  • SKY05 Profile Picture
    20 on at

    Thank you so much for your reply. But still collection is null in Power Automate flow.

    Below code is working fine. Only when I add filter condition to retrieve items between two days then collection is null.

    Working code:- 

    ClearCollect(colSPListItems,ShowColumns(ListName,"Title","FirstName","LastName","Status"));
    Set(varFileLink,ExportToExcel.Run(JSON(colSPListItems,JSONFormat.IgnoreBinaryData&JSONFormat.IgnoreUnsupportedTypes)).filelink);Launch(varFileLink);

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Please help into this .. Code is working fine to export list items into excel. Only when I use filter condition to retrieve items between two date then collection is null in Power Automation flow.

     

    Thanks,

    SKY

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

    @SKY05 ,

    The issue is your filter, not the Flow - if you do this in a gallery Items, do you get any records ?

    Filter(
     ListName,
     startDate.SelectedDate >= Created And 
     endDate.SelectedDate <= Created
    )

     

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard