cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Blanke
New Member

Create CSV table with custom columns from Filter Array Output

Goal: Export items from Sharepoint list, filter records, convert to csv with custom columns, and save to Sharepoint folder.

 

Flow:

  1. Get Items - Sharepoint List
  2. Filter Array - Filter calculated column
  3. Create CSV Table - Custom columns
  4. Create File - Save CSV to Sharepoint folder

Issues:

  1. Can't create ODATA filter based on calculated column. So I created Filter Array step to filter based on calculated column.
  2. Create CSV table won't allow creating custom columns using output from Filter Array step. Field list is lost in Filter Array step, so can't select fields for custom columns. 

Blanke_0-1610992018209.png

I don't want to output all the columns from my Sharepoint list. My calculated column is a TRUE/FALSE column calculating whether a date in the list item is in the current fiscal year (Oct to Sept). 

 

Filter Array filter: @equals(item()?['CurrentFYFilter'], '1')

 

Are there any other ways to achieve filtering my list and outputting only the columns I want? 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User III
Super User III

Use the run history to copy the output of your filter. Edit your flow and then add a parse json step after your filter and use the output you copied as the sample to generate a schema. Then you will be able to select fields from it and formulate your CSV to your liking.

View solution in original post

3 REPLIES 3
Paulie78
Super User III
Super User III

Use the run history to copy the output of your filter. Edit your flow and then add a parse json step after your filter and use the output you copied as the sample to generate a schema. Then you will be able to select fields from it and formulate your CSV to your liking.

View solution in original post

Pstork1
Dual Super User III
Dual Super User III

A couple things that will help.

1) In the Get items you can use a SharePoint View to limit the number of columns that are returned.  (this will include the system columns and any columns specified in the view)

2) You can also use a Select with the Array of Items from Get Items to limit and rename any specific columns that you want to include in the output.

3) After doing a Filter Array you need to do a Parse JSON on the output to get the column definitions from the filter as dynamic content.

 

So your process should be

  1. Get Items - Sharepoint List
  2. Filter Array - Filter calculated column
  3. Parse JSON - Parse the array produced by the Filter Array
  4. Data Select - Choose the columns you want in the CSV table from the output of #3
  5. Create CSV Table - Custom columns
  6. Create File - Save CSV to Sharepoint folder


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thank you that was a very quick and easy answer!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (2,001)