cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NurNina
Post Patron
Post Patron

Export data from d365 F&O to csv file

Hi, I am new to d365 f&O.  I want to export data from f&O to csv file using power automate. Is there any sample that I can learn from? 

7 REPLIES 7
Expiscornovus
Super User
Super User

Hi @NurNina,

 

Out of interest, is there a specific requirement that you want to use Power Automate over the Data Management export feature?

 

With that feature you can very easily create csv data exports:

https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/data-entities-data...

 

Otherwise you could use the approach below in Power Automate.

 

1. Add a list items present in table action. Configure it to use your preferred instance and table. 

In my example I was only retrieving 5 CustomersV3 records. 

 

2. Add a Create CSV Table action. Use the value field

 

3. Add a Create File action, in my example in OneDrive for Business. Use the output of the Create CSV Table action for the File Content field.

 

customersv3export.png

@Expiscornovus thank you for the suggestion!

 

the goal is to export data from F&O using automate and create the file inside FTP. However, the data format in csv should be in semicolon separated

Expiscornovus
Super User
Super User

Hi @NurNina,

 

You can't set the delimiter in that create csv table action.

 

However, you could use a workaround for that. You can use custom formatting instead of automatic formatting in that create csv table action.

 

With this custom formatting you can add a character pattern which is easily replaceable. This is needed because if you would just replace a comma character you might be replace valid content as well.

 

You can find that approach in this thread: https://powerusers.microsoft.com/t5/Building-Flows/Change-the-delimiter-when-creating-a-CSV-file/m-p...

 

I have created an example for that.

 

This expression is added in a compose action. It identifies |,| and replaces it by ;

replace(body('Create_CSV_table'),'|,|',';')

 

repalcepipecharacters.png

 

hi @Expiscornovus ,

thanks for the reply. I've found that there is a create file function for FTP. However, I'm not sure how to pull only data created today from the list of items, based on the created  date and time. 

Expiscornovus
Super User
Super User

Hi @NurNina,

 

Does your entity have an creation date time field?

 

If so, you could potentially use a filter array to filter the results from the list items present in table action.

 

After that you can use the filtered array instead of the original array in the from field of the Create CSV table action.

 

Below is an example with the CDSSalesOrderHeaders entity. I know that entity has a created date time field.

 

filterarray_createdtoday.png

Hi @Expiscornovus , I've tried this and apparently it doesn't export the data needed from f&O. It only creates the csv table that is needed. Am I missing any step? 

 

NurNina_0-1629712299758.png

NurNina_1-1629712391294.png

 

 

Expiscornovus
Super User
Super User

Hi @NurNina,


I see that your Create CSV table is within an apply to each action. It looks like it is creating a csv table per item. Can you remove the apply to each action?

 

You can use expressions to retrieve the property values and to avoid that Power Automate automatically generates a Apply to each action.

 

This is for example the expression for the SalesOrderNumber property:

item()?['SalesOrderNumber']

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,982)