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 / Export filtered data f...
Power Apps
Answered

Export filtered data from Gallery and convert it csv file and send via email

(0) ShareShare
ReportReport
Posted on by 94

@BCBuized/ Community

 

Good Day,

 

I am working on an internal project where I have built a power app to track the Tasks for a project. I need to export the filtered gallery data to MS flow via the power apps trigger, wherein I watched several videos but was not able to achieve this as it threw an error I also tried to find posts in the community that do not meet the actual requirement . Kindly please help in achieving this 

 

Below is the code used on the button which creates a collection named FilteredCollection from the Gallery which has to be triggered to Flow.

ClearCollect(

    FilteredCollection,

    Filter(

        'PMIT TRACKER OMC AUT',

 IsBlank(ComboBoxAIGroup.SelectedItems.Value) || IsEmpty(ComboBoxAIGroup.SelectedItems.Value) || 'AI Group'.Value = ComboBoxAIGroup.Selected.Value,

        IsBlank(ComboBoxTaskStatus.SelectedItems.Value) || IsEmpty(ComboBoxTaskStatus.SelectedItems.Value) || 'Task Status'.Value = ComboBoxTaskStatus.Selected.Value,

        'Target Date' >= DPFrom.SelectedDate && 'Target Date' <= DPTo.SelectedDate

    )

);

 

I have followed Reza's video on the web and created the flow as below with Get Items (SP)

vrevankar_0-1695621458800.pngvrevankar_1-1695621480934.png

Not sure the Odata query used in the filter query is up to the mark also 

 

again on the same select button tried with the following code to trigger the flow which is not working 

 
PMITex.Run(field_3 eq ComboBoxAIGroup.Selected.Value,field_10 eq ComboBoxTaskStatus.Selected.Value, Text(DateFrom_1.SelectedDate,"yyyy-mm-dd"), Text(DateTo_1.SelectedDate,"yyyy-mm-dd"), User().Email);

 

Kindly request that someone help with this

 

Thanks in advance 🙂

 

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @vrevankar ,

     

    Please try below formula on the Button:

    PMITex.Run(ComboBoxAIGroup.Selected.Value,ComboBoxTaskStatus.Selected.Value, Text(DateFrom_1.SelectedDate,"yyyy-mm-dd"), Text(DateTo_1.SelectedDate,"yyyy-mm-dd"), User().Email);

     

    Best regards,

  • vrevankar Profile Picture
    94 on at


    @v-jefferni  Thank you so much for the quick response sir the code works fine and the flow ran successfully but I'm receiving emails with blank data as below can you suggest what could have gone wrong 

     

    vrevankar_0-1695623632901.png

     

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @vrevankar ,

     

    In run history of the flow, please check if Get items action has returned expected result. If the result is blank, then the query may still have some mistakes.

     

    I see you have a Query in PowerApps trigger, but it's not used in Filter query, what's it for?

     

    Best regards,

  • vrevankar Profile Picture
    94 on at

    @v-jefferni  I checked the Get Items Inputs which has fed the correct input as below

    {
        "host": {
            "connectionReferenceName""shared_sharepointonline",
            "operationId""GetItems"
        },
        "parameters": {
            "dataset""https://dxcportal.sharepoint.com/sites/AMSOMC",
            "table""f6071e2d-1d89-419c-b051-f55a6889f76c",
            "$filter""(field_3 eq 'HPI') and (field_10 eq' Open ') and (field_1 ge'2023-08-01' ) and (field_1 le'2023-08-31')",
            "$top"5000
        }
    }
    but the output is showing blank as below 
    vrevankar_0-1695625117747.png

    export button has current code used 

    ClearCollect(
        FilteredCollection,
        Filter(
            'PMIT TRACKER OMC AUT',
            IsBlank(ComboBoxTaskStatus.SelectedItems.Value) || IsEmpty(ComboBoxTaskStatus.SelectedItems.Value) || 'Task Status'.Value = ComboBoxTaskStatus.Selected.Value,
            'Target Date' >= DPFrom.SelectedDate && 'Target Date' <= DPTo.SelectedDate
        )
    );
    PMITex.Run(ComboBoxAIGroup.Selected.Value,ComboBoxTaskStatus.Selected.Value, Text(DPFrom.SelectedDate,"yyyy-mm-dd"), Text(DPTo.SelectedDate,"yyyy-mm-dd"), User().Email);
    which filters the data on the gallery and sends the collection to flow 
     
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @vrevankar ,

     

    Based on my test, you need to remove the spaces inside single quates beside Query2. 

    "(field_3 eq 'HPI') and (field_10 eq 'Open') and (field_1 ge '2023-08-01') and (field_1 le '2023-08-31')"

     

    Best regards,

  • Verified answer
    vrevankar Profile Picture
    94 on at

    @v-jefferni Kudos sir that worked appreciate your help here 🙂

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard