Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
data_edifyedu
Regular Visitor

Flask App not passing variable to Javascript function

I'm kind of newbie in Power Bi embedded, webapps and similar topics.

But, I'm trying to create a portal, for sharing reports with people outside my organization (It's a little compaty, and doesn't fit the Power Bi Premium on our budget).

For this, I've discovered the Power Bi embedded solution and get the hands on the Webapplication.

I already have a power bi Pro licence, and I've created the application id, and etc 

So far so good, except the parameter for the embed_info is not passing to the javascript function. (All of those I've got on microsoft's github).

 

Here is the route code:

@views.route('/render_report/<string:rep>/<string:usr>', methods=['GET','POST'])
@login_required
def render_report(rep,usr):
    userid = usr
    reportid = rep

    new_record = ReportViews(report_id=reportid, user_id=userid)
    db.session.add(new_record)
    db.session.commit()
    
    user=current_user.id
    report = Report.query.filter(Report.id.like(reportid)).first()
    wrkid = report.pbiworkspaceid
    repid = report.pbireportid

    embed_info = PbiEmbedService().get_embed_params_for_single_report(workspace_id=wrkid, report_id=repid)
    embed_json = json.loads(embed_info)
    url = embed_json['reportConfig'][0]['embedUrl']

    #return embed_info
    return render_template("render.html", embed_info=embed_info, user=current_user, report=report, url=url)
 
@views.route('/render', methods=['GET'])
@login_required
def render():
    return jsonify({})
 
And here the HTML page of "render" is here
data_edifyedu_0-1618327466898.png

 

In my base.html I've the script part aswell

data_edifyedu_1-1618327496927.png

 

Please help me!
 
Many thanks
Omar
1 REPLY 1
Anonymous
Not applicable

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.