web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error write data infor...
Power Automate
Unanswered

Error write data information in excel.

(0) ShareShare
ReportReport
Posted on by 12

Could you guys help me with a subject, I'm trying to create a simple flow to update a database in Excel from a csv file... I created the flow correctly but I have a bug that when the action will record the csv information in Excel the date column goes to Excel in the format of another region... for example in the csv the date is 02/05/2024 (DD/MM/YYY) however when the automate writes it to excel it changes to 05/02 /2024(MM/DD/YYY). Does anyone know how to solve it?
NOTE: My Region is PT-BR, I use this format in Excel (DD/MM/YYY).

 

csv file:

roniercassio_1-1714770867103.png

 

In Excel after execution automate:

roniercassio_2-1714770926893.png

 

 

 

 

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @roniercassio 

     

    What is your system date format? I believe that also in "MM/DD/YYY" while you write date in excel file through PAD it will write date based on system date format only. If you want to change them, please consider some macro function for the same.

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • roniercassio Profile Picture
    12 on at

    My system format is dd/mm/yyy pt-br.

     

  • roniercassio Profile Picture
    12 on at

    Any Solution for this question? 

  • VishnuReddy1997 Profile Picture
    2,656 Super User 2025 Season 2 on at

    Hi @roniercassio ,

     

    Please Convert DateTime to text and then write it to the excel as shown in below image.

    VishnuReddy1997_0-1714969791619.png

     

    (Note:- if you got your solution you can mark as solution and gives kudos)

     

    Thanks & Regards

    Vishnu Reddy

     

     

  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @roniercassio 

     

    Follow the below approach:

    My CSV file looks like this

    Deenuji_0-1714979518854.png

     

    My flow screenshot:

    Deenuji_1-1714979556206.png

     

    Tip: Write current item value as text and replace with empty string like below:

    Deenuji_2-1714979614970.png

    Deenuji_3-1714979720698.png

     

    Output:

    Deenuji_5-1714979894593.png

     

     

     

    Code:

    File.ReadFromCSVFile.ReadCSV CSVFile: $'''C:\\Boot\\CSVTable.csv''' Encoding: File.CSVEncoding.UTF8 TrimFields: True FirstLineContainsColumnNames: True ColumnsSeparator: File.CSVColumnsSeparator.SystemDefault CSVTable=> CSVTable
    Excel.LaunchExcel.LaunchUnderExistingProcess Visible: True Instance=> ExcelInstance
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: CSVTable.ColumnHeadersRow Column: $'''A''' Row: 1
    LOOP FOREACH CurrentItem IN CSVTable
     Excel.GetFirstFreeRowOnColumn Instance: ExcelInstance Column: $'''A''' FirstFreeRowOnColumn=> FirstFreeRowOnColumn
     Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: $'''\'%CurrentItem['DataEntrega']%\'''' Column: $'''A''' Row: FirstFreeRowOnColumn
    END
    Excel.FindAndReplace.FindAndReplaceAll Instance: ExcelInstance TextToFind: $'''\'''' TextToReplaceWith: $'''%''%''' MatchCase: False MatchEntireCellContents: False SearchBy: Excel.SearchOrder.Rows Cells=> Cells
    Excel.SaveExcel.SaveAs Instance: ExcelInstance DocumentFormat: Excel.ExcelFormat.OpenXmlWorkbook DocumentPath: $'''C:\\Boot\\ConvertedCSVExcel'''
    Excel.CloseExcel.Close Instance: ExcelInstance

     

     

    How to copy/paste the above code into your power automate desktop?

    Deenuji_4-1714979758048.gif

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • roniercassio Profile Picture
    12 on at

    Thank you so much for trying to help me!! The suggested solution worked partially, however my csv spreadsheet has several columns 3 of these columns count dates, I don't know how to update in a database in excel in specific columns and respecting the date information (dd/MM/YYYY).

     

    Your Solution Work for simples Convertion But last step read and replace dont work there.

     

     

    roniercassio_0-1715080784132.png

    Write and Replace Action

    roniercassio_1-1715080886970.png

     

    Final Result: in Excel the " ' " 

    roniercassio_2-1715080924783.png

     

     

     

  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @roniercassio 

     

    Could you pls share screenshot of your complete csvtable?

  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @roniercassio 

     

    Please find the updated approach:

    Deenuji_0-1715139439702.png

    Note: Find and replace is not required right now

     

    Code:

     

    File.ReadFromCSVFile.ReadCSV CSVFile: $'''C:\\Boot\\CSVTable.csv''' Encoding: File.CSVEncoding.UTF8 TrimFields: True FirstLineContainsColumnNames: True ColumnsSeparator: File.CSVColumnsSeparator.SystemDefault CSVTable=> CSVTable
    Excel.LaunchExcel.LaunchUnderExistingProcess Visible: True Instance=> ExcelInstance
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: CSVTable.ColumnHeadersRow Column: $'''A''' Row: 1
    SET Rowcounter TO 2
    LOOP LoopIndex FROM 0 TO CSVTable.RowsCount - 1 STEP 1
     Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: CSVTable[LoopIndex]['DataEntrega'] Column: $'''A''' Row: Rowcounter
     Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: CSVTable[LoopIndex]['DataXYZ'] Column: $'''B''' Row: Rowcounter
     Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: CSVTable[LoopIndex]['DataABC'] Column: $'''C''' Row: Rowcounter
     SET Rowcounter TO Rowcounter + 1
    END
    Excel.FindAndReplace.FindAndReplaceAll Instance: ExcelInstance TextToFind: $'''\'''' TextToReplaceWith: $'''%''%''' MatchCase: True MatchEntireCellContents: False SearchBy: Excel.SearchOrder.Rows Cells=> Cells

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • roniercassio Profile Picture
    12 on at

    Tank you.. but dont work there ;/

    roniercassio_0-1715188643028.png

     

    My csv file Estructure.

    roniercassio_1-1715188855318.png

    i need put all this informations in a base. in Collum C:M. its have many rows about 2k+

     

     

     

  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @roniercassio 

     

    Please elaborate what is not working ?

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard