I am using code, to export the gallery date to Csv Table via power automate flow.
All is working, no issue.
Only the problem is the date format, it is not in the way, it set it to be.
My code is as below:
Clear(colSvcExportData);
ForAll(
SupportSvcGallery.AllItems As SvcExportData,
Collect(
colSvcExportData,
{
RecoNo: SvcExportData.RecoNo,
SvcDate: Text(SvcExportData.SvcDate,"dd-mm-yyyy"),
Model: SvcExportData.Model,
SerialNo: SvcExportData.SerialNo,
SvcSMR: SvcExportData.SvcSMR,
SvcRemarks: SvcExportData.SvcRemarks,
SvcExpense: SvcExportData.SvcExpense,
Customer: SvcExportData.Customer
}
)
);
Set(JSONFileSvcExpo,JSON(colSvcExportData)); //this line hold the data in JSON format
Excel CSV Result is as below:
Please guide what correction to be done to get the date in dd-mm-yyyy
Just wanted to update you my findings during testing. May be useful for someone who may be reading later our subject issue.
The issue is in online excel only (it brings dd-mm-yyyy), no issue, but some where by '/' separator, some where '-' separator.
For example, instead of saving to ónedrive, I attached the file in email as csv via power automate.
Noted:
a) when the file downloaded to pc and then opened, it is perfect as wanted and dd-mm-yyyy
b) but the attachment when open staying in email box via online excel, it show the disturbed format as shown in the first image.
Anyhow, at least download works,
Thank you.
@MIA27 ,
The problem I believe (and I have encountered it before) is that you need to send dates to Power Automate in yyyy-mm-dd format. I can also tell you that dates in dd-mm-yyyy simply do not work. You may need two JSON statements.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
Dear Mr. Warren,
Thank you for your guide, But I am confused in this situation.
As I mentioned in my first post, JSON data is used in the flow.
I created one flow first it collect JSON data and create CSV and save it to one drive, then under the same flow, with
the same JSON create HTML Table and use to send email in a proper formatted way. Below is the screen shot of the email generated from the same flow.
In this HTML table, it can be noted in the below image that it is correct "dd-mm-yyyy".
Confused here, if JSON to CSV is issue here, But JSON to HTML picks correct.
Need your guidance is it possible to create flow in this way:
JSON .........To build...........HTML Table...........and from this to................CSV also
Instead of JSON to csv creation. Can I create HTML to CSV.
I know this is not the correct community, as you are guiding me on this issue. if you can guide more, as posting to new thread will go a new and will need to explain again whole.
As trying to avoid the change in the format in code, as it will affect my html table to email format.
@MIA27 ,
Power Automate does not like dates in the "correct" format the rest of the world outside the USA uses - dd/mm/yyyy - try this instead
SvcDate: Text(SvcExportData.SvcDate,"yyyy-mm-dd"),
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
146,537
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,908
Most Valuable Professional