web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / "JSON parsing error, e...
Power Apps
Answered

"JSON parsing error, expected 'number' but got 'string'" error in embedded Power Apps in Power BI report

(1) ShareShare
ReportReport
Posted on by 43

I'm new to both Power Apps and Power BI. I'm trying to do the write-back where I click on Power BI charts and it changes data in Power App and editing the data in Power Apps also saves the data back to data source.

 

Now my app is ready. In Power Apps Studio, the data shown in app changes dynamically when clicking on the Power BI report charts. This indicates that Power Apps and Power BI are connected.

 

However, in the embedded Power Apps section in Power BI report, it shows red error banner saying "JSON parsing error, expected 'number' but got 'string'." then it disappears and my Power Apps gallery doesn't show any data. I tried removing the embedded Power Apps from Power BI report and added it back again, select existing app and publish the app again, but still got the same error.

 

PitawatN_0-1679389671516.png

 

Please advise. I'm not sure if this is the error from Power Apps or Power BI or if this is the right place to ask. Thanks.

Categories:
I have the same question (0)
  • LuizVicente Profile Picture
    984 Super User 2024 Season 1 on at

    Hmm.. try this:

     

    "type": ["integer", "string"]
  • PitawatN Profile Picture
    43 on at

    Hi @LuizVicente, thanks for your reply. But where exactly should I put that line?

  • Verified answer
    PitawatN Profile Picture
    43 on at

    I have solved the problem. Turns out the data from Power BI has some values as 0 and Power Apps sees it as blank or string or something hence the error on Power BI. Weird that it runs perfectly fine in Power Apps Studio.

     

    I had to handle the value 0 by using:

    If(IsBlankOrError(Value),0,Value)

     This will make sure the value, whether blank or zero, will be number zero.

  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @PitawatN 

     

    Glad to see you solved the problem.

    You could mark your answer/solution as a 'Solution' to allow more people with the same problem to solve their own problem as quickly as possible.

    Thank you so much! 

     

    Best Regards,

    Levi

  • Aron3 Profile Picture
    5 on at

    Where did you make the change?

  • PitawatN Profile Picture
    43 on at

    As I mentioned in my reply above, I had to handle all zeros and/or blank values from Power BI. So to answer your question of "where", I'd say everywhere the app is using said values.

  • StevenRichards Profile Picture
    155 on at

    Not sure if you're still look

    Collect(
     colSparePartsList,
     {
     ContractNumber: ContractNumber.Text,
     QuantityReceived: If(
     IsBlankOrError(QuantityReceived.Text),
     0,
     Value(QuantityReceived.Text)
     ),
     QuantityRequested: QuantityRequested.Text,
     QuantityShipped: QuantityShipped.Text,
     PartsBoxNumber: PartsBoxNumber.Text,
     Description: Description.Text
     }
     )

    ing for an answer but in my case I had to collect it.

  • EddieE Profile Picture
    4,641 Moderator on at

    @PitawatN 

    Thanks mate! You just saved my afternoon of Googling haha

  • Warric Profile Picture
    3 on at

    Hi @StevenRichards , I dynamically pass my coloumns from PowerBi to Powerapps. 

    Is there any way to dynamically pass the column names to your formula, I have the column names in a collection?

    Or is their anyway to remove all blanks from a collection without using column names?

  • StevenRichards Profile Picture
    155 on at

    Sorry, no, I can't help with that.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 833

#2
Valantis Profile Picture

Valantis 563

#3
Haque Profile Picture

Haque 383

Last 30 days Overall leaderboard