Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Gallery data is taking in proper format in Json for export

(0) ShareShare
ReportReport
Posted on by

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:

 

MIA27_0-1714371312598.png

 

Please guide what correction to be done to get the date in dd-mm-yyyy

 

 

 

  • MIA27 Profile Picture
    on at
    Re: Gallery data is taking in proper format in Json for export

    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.

     

     

  • Verified answer
    WarrenBelz Profile Picture
    146,537 Most Valuable Professional on at
    Re: Gallery data is taking in proper format in Json for export

    @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

  • MIA27 Profile Picture
    on at
    Re: Gallery data is taking in proper format in Json for export

    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_1-1714405082632.png

     

     

     

     

  • WarrenBelz Profile Picture
    146,537 Most Valuable Professional on at
    Re: Gallery data is taking in proper format in Json for export

    @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

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,537 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,908 Most Valuable Professional

Leaderboard