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 Automate / Facing issue while wri...
Power Automate
Answered

Facing issue while writing data from data table to Excel

(0) ShareShare
ReportReport
Posted on by 159

Hi,

I am facing a weird issue while using "Write to excel" activity and writing data from data table using sql script, but zeros are removing.

i have records are like - 00013 

neerajpokh_0-1658428801795.png

and using sql script to read data

neerajpokh_1-1658429014280.png

 

after that using "write to excel" activity but its not writing original data, means removing zeros 

neerajpokh_2-1658429128603.png

can you please help on this urgently as stucked from last 3 days

 

 

 

I have the same question (0)
  • ryule Profile Picture
    929 Super User 2024 Season 1 on at

    Have you confirmed it's reading the data correctly? It could just be an Excel issue (cell type) where you are writing the data, if it is reading it correctly.

  • neerajpokh Profile Picture
    159 on at

    yes everything is correct, datatable has correct data only changing while writing

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Try putting a single-quote ' in the input before your data in the Write input.

  • neerajpokh Profile Picture
    159 on at

    i have thousand record, loop can't apply for that

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    What...?

    How does your Write to Excel action look?

  • neerajpokh Profile Picture
    159 on at

    neerajpokh_0-1658476376310.png

     

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Try adding the single quote to the datatable column to see if it fixes the formatting.

    Method:

    SET Datatable TO {['R1C1', 'R1C2'], ['R2C1', 'R2C2'] }
    LOOP LoopIndex FROM 0 TO Datatable.RowsCount - 1 STEP 1
    SET Datatable[LoopIndex][0] TO $'''\'%Datatable[LoopIndex][0]%'''
    END

  • neerajpokh Profile Picture
    159 on at

    i am using below script

    SELECT [Employee ID],[Legal Name - Last Name], [Legal Name - First Name], [Company], [Benefit Group], [Benefit Plan], [Hire Date], [Date of Birth], [Age], [Coverage] FROM [Sheet1$] WHERE ([Benefit Group] <> 'Union'

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Yes, and that SQL statement produces a datatable, which I would like you to loop through and modify:

    Henrik_M_0-1658480183770.png

     

  • neerajpokh Profile Picture
    159 on at

    actually i have thousands rows, so loop is not possible with huge records

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 481

#2
11manish Profile Picture

11manish 278

#3
David_MA Profile Picture

David_MA 276 Super User 2026 Season 1

Last 30 days Overall leaderboard