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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.