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 Apps / Issue with direct down...
Power Apps
Unanswered

Issue with direct download code in power app

(0) ShareShare
ReportReport
Posted on by 9
GM Everyone
 
I am seeking help in direct code to download data verse table in csv. Below code added on "On Select":
 
 
// Part 1
Set(
    dsCombined,
    <Tablename>
);
 
// Part 2 Header row (quoted)
Set(
    headerRow,
    """Period"",""Category"""
);
 
// Part 3 Body rows: build CSV lines, escape embedded quotes in every field
 
Set(
    csvBody,
    Concat(
        dsCombined,
        """"
        & Substitute(period<Field name per data verse table> & "", """", """""")
        & ""","""
        & """"
        & Substitute(category <Field name per data verse table> & "", """", """""")
        & """"
        & Char(13) & Char(10)      // CRLF per row
    )
);
 
// 3) Combine header + body
Set(
    csvAll,
    headerRow & Char(13) & Char(10) & csvBody
);
 
// 4) Trigger download (single-argument Download; BOM; replace '+' with '%20')
 
Download(
    "data:text/csv;charset=utf-8," & EncodeUrl(csvAll)
);
 
 
We are getting error message with Part 4 download part, The URL passed to the function is not valid. Could some one please guide this is required on Canvas app or any other way to write download section.
 
Regards
Mohit
I have the same question (0)

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard