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 / How to update datatabl...
Power Automate
Unanswered

How to update datatable - need leading zeros

(0) ShareShare
ReportReport
Posted on by 17

I'm attempting to update data in a datatable that is created from an Excel SQL connection by padding text of 0 to a value if the length is less than 9. When I import the data directly from Excel, the find or replace feature works (updates the original value with a 0+value. When I import the data using a SQL connection to the very same Excel file, the find or replace feature does not work (no leading zeros).

 

Excel import (works): 

excel.jpg

 

SQL import (does not work):

sql.jpg

 

While not the case in the above examples, I'm using SQL connection so that I can filter the data from Excel. Because I'm appending leading zeros, Excel is dropping the leading zeros when I simply write back to the original file.

 

My goal would be to pad text with leading zeros to the datatable that was created PAD. Help! Thank you!

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @schill27 

     

    What you are trying to convery here, for importing from excel, when you tried padding zeros to a cell in datatable,

    and written to excel, you can see the zeros on left . 

     

    When imported from sql, same operation is performed but when written to excel, it shows non-padded result even zero are added to the cell value, am i right ?

  • schill27 Profile Picture
    17 on at

    Hi @Nived_Nambiar,

    You're close. I'm not writing back to Excel after padding zeros but rather updating the datatable where the original data was imported (from Excel or SQL).

  • jp_fc Profile Picture
    35 on at

    I would try to include the zeroes in the SQL query (e.g. select right(replace(str(*),' ','0'),1) from [Sheet1$] or whatever) and see if that might work

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @schill27 

     

    In case of sql, after modifying the datatable, have you seen the datatable, does it has leading zeros ?

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 317 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 247

#3
Henil Profile Picture

Henil 117

Last 30 days Overall leaderboard