cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zoran
Helper I
Helper I

Invalid type. Expected String but got Null

Hi,
 
I'm getting following error when I "Parse JSON".
 
{
    "errors": [
        {
            "message""Invalid type. Expected String but got Null.",
            "lineNumber"0,
            "linePosition"0,
            "path""[15]['\"Betalarens kontonr.\"']",
            "schemaId""#/items/properties/\"Betalarens kontonr.\"",
            "errorType""type",
            "childErrors": []
        },
 
Zoran_0-1629894818914.png

 

Here is my schema
{
    "type""array",
    "items": {
        "type""object",
        "properties": {
            "\"Leveransref.: \"": {
                "type""string"
            },
            "\"Leveransdatum: \"": {
                "type""string"
            },
            "\"Buntbelopp: \"": {
                "type""string"
            },
            "\"Mottagarens kontonr: \"": {
                "type""string"
            },
            "\"Summa ej avstämt\"": {
                "type""string"
            },
            "\"Valuta\"": {
                "type""string"
            },
            "\"Datum. \"": {
                "type""string"
            },
            "\"Klient: \"": {
                "type""string"
            },
            "\"Filnamn: \"": {
                "type""string"
            },
            "\"Referens\"": {
                "type""string"
            },
            "\"Betalarens kontonr.\"": {
                "type""string"
            },
            "\"Summa från betalare\"": {
                "type""string"
            },
            "\"Fritext1\"": {
                "type""string"
            },
            "\"Fritext2\"": {
                "type""string"
            },
            "\"Total IN transaktionsl�pnummer\"": {
                "type""string"
            },
            "\"Mottagande bankgironummer\"": {
                "type""string"
            },
            "\"Organisationsnummer\"": {
                "type""string"
            },
            "": {}
        },
        "required": [
            "\"Leveransref.: \"",
            "\"Leveransdatum: \"",
            "\"Buntbelopp: \"",
            "\"Mottagarens kontonr: \"",
            "\"Summa ej avstämt\"",
            "\"Valuta\"",
            "\"Datum. \"",
            "\"Klient: \"",
            "\"Filnamn: \"",
            "\"Referens\"",
            "\"Betalarens kontonr.\"",
            "\"Summa från betalare\"",
            "\"Fritext1\"",
            "\"Fritext2\"",
            "\"Total IN transaktionsl�pnummer\"",
            "\"Mottagande bankgironummer\"",
            "\"Organisationsnummer\"",
            ""
        ]
    }
}
 
I have tried to edit the schema according to below picture, but I have not managed get it right.
Zoran_1-1629895345307.png

 

Please help me edit the attached schema so that it includes "null". 

Thanks!

3 ACCEPTED SOLUTIONS

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @Zoran ,

 

You are on the right track.  You just need to do the same for Betalarens kontonr and any other field which is nullable (can also be empty)

 

Screenshot_20210825-225045_Chrome.jpg

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

Pstork1
Dual Super User III
Dual Super User III

The error is referring to the "Betalarens kontonr" field.  So that is the schema that should be edited.  It should be

            "\"Betalarens kontonr.\"": {
                "type": ["string", "null"]
            },


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

eric-cheng
Solution Sage
Solution Sage

Hi @Zoran ,

 

The error is now indicating another field.  You need to repeat this for ALL fields which are nullable or can be null.  

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

5 REPLIES 5
eric-cheng
Solution Sage
Solution Sage

Hi @Zoran ,

 

You are on the right track.  You just need to do the same for Betalarens kontonr and any other field which is nullable (can also be empty)

 

Screenshot_20210825-225045_Chrome.jpg

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

Pstork1
Dual Super User III
Dual Super User III

The error is referring to the "Betalarens kontonr" field.  So that is the schema that should be edited.  It should be

            "\"Betalarens kontonr.\"": {
                "type": ["string", "null"]
            },


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

I believe that all of my lines will need to be able to handle the "null"

Zoran_0-1629896549640.png

Is it OK to add "null" to all even though it may be so that some will be using only the "string"?

I followed the instructions, however as you can see below in the picture "string" & "null" text is coloured red and not blue as it should be. What's wrong?  

Zoran_1-1629896706922.png

 

eric-cheng
Solution Sage
Solution Sage

Hi @Zoran ,

 

The error is now indicating another field.  You need to repeat this for ALL fields which are nullable or can be null.  

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,082)