Skip to main content

Notifications

Community site session details

Community site session details

Session Id : edh3d6Fyi3rAJgNMpjBKR7
Power Apps - Building Power Apps
Answered

Custom connector error "JSON parsing error, excepted 'string' but got 'object'."

Like (0) ShareShare
ReportReport
Posted on 24 Apr 2023 09:07:59 by 9
  • My first Power Apps show an error when getting data from my custom connector:

         JSON parsing errorJSON parsing error

 

  •  My code in Power Apps button click:

         Code in Power Apps button ClickCode in Power Apps button Click

  • My custom connector was built with Web API, and these code from my action:

        Code in Web API ActionCode in Web API Action

 

All code above is simple, and I find a similar question with a reply by 'Solution Supplier', he suggests questioner to use the flow instead of directly executing:

     https://powerusers.microsoft.com/t5/Building-Power-Apps/Custom-connector-error-quot-JSON-parsing-error-expected-object/m-p/1340566 

 

Should I also use this method to solve my error?

   

 

 

 

 

Categories:
  • EA_ITEngineer Profile Picture
    9 on 25 Apr 2023 at 02:44:36
    Re: Custom connector error "JSON parsing error, excepted 'string' but got 'object'."

    Attach new settings:

     

    completed setting of custom connectorcompleted setting of custom connector

  • EA_ITEngineer Profile Picture
    9 on 25 Apr 2023 at 02:30:47
    Re: Custom connector error "JSON parsing error, excepted 'string' but got 'object'."

    Hi @victorcp,

    I have found lack of type setting in my custom connector ,  so your suggestion do work after I complete setting.

     

    Thanks.

  • EA_ITEngineer Profile Picture
    9 on 25 Apr 2023 at 01:16:02
    Re: Custom connector error "JSON parsing error, excepted 'string' but got 'object'."

    Hi @victorcp ,

    I have adopted your code, but Power apps still shows the same error.

    • On the other Hand, I can't call the fields (such as, Date) of the WeatherObj without using the ParseJson function.

              I guess the ParseJson function which looks like the var keywork in C# converts a json string to be an untyped               object,  so I can call some fields of the 'WeatherObj', just like the picture as followed:

            

              new error without using ParseJson functionnew error without using ParseJson function

     

    • Additionally, my custom connector settings as followed:

          Custom Connector SettingCustom Connector Setting

     

    Thanks        

     

  • Verified answer
    victorcp Profile Picture
    2,347 Super User 2025 Season 1 on 24 Apr 2023 at 09:43:33
    Re: Custom connector error "JSON parsing error, excepted 'string' but got 'object'."

    Hi,

    Looks like it is not necessary to use the ParseJson function because the custom connector already parse it to you, so try this:

    Set(
    WeatherObj,
    LocalWebAPI.CallLocalAPI()
    );
    

     

    Please let me know if it worked, if not please share the error

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,769 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started