Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Parse JSON - Weird Invalid type error

(0) ShareShare
ReportReport
Posted on by 54

Hello everyone,

 

Some context regarding my issue :

I have a SharePoint List collecting all the claims regarding a specific process. Those claims are created with a PowerApps form.

Several people must modify informations on the claims depending of the situation in the process but only the creator of the claim must change the status to "Completed".

 

I am not able to activate the item level restriction to creator only because since several people must modify the claims at some point.

To make sure that only the creator of the claim is able to modify the status value to "Completed" I have created a flow.

 

My flow :

 

1- Trigger : When an item is created or modified on SharePoint  (condition to trigger the flow : Status value must be "Completed").

2- Condition : Editor = Author

If yes : Do nothing.

 

If no :

3- Message : Define the before last Version Number by using the folowing formula and adding ".0" to it :

sub(int(items('Apply_to_each')?['{VersionNumber}']),1)

ZekO_0-1700151347988.png

(I will need this information at the end of my flow)

 

4- I need to retreive the Status value of the before last Version Number so first I need to Get the versions numbers and the values in it.

ZekO_2-1700151548625.png

 

5- Parse JSON so I can retreive the values of the HTTP request easily. This is where I have my issue.

ZekO_3-1700151745151.png

The content is the body of my HTTP request

The Schema is a copy paste from the result of the HTTP request body :

ZekO_5-1700152001562.png

 

When I run a test I have the following error message :

{
 "errors": [
 {
 "message": "Invalid type. Expected String but got Null.",
 "lineNumber": 0,
 "linePosition": 0,
 "path": "d.results[12].dateassigned_x005f_x002b_x005f_2",
 "schemaId": "#/properties/d/properties/results/items/properties/dateassigned_x005f_x002b_x005f_2",
 "errorType": "type",
 "childErrors": []
 },
 {
 "message": "Invalid type. Expected String but got Null.",
 "lineNumber": 0,
 "linePosition": 0,
 "path": "d.results[13].dateassigned_x005f_x002b_x005f_2",
 "schemaId": "#/properties/d/properties/results/items/properties/dateassigned_x005f_x002b_x005f_2",
 "errorType": "type",
 "childErrors": []
 }
 ]
}

 

When try to change the type of this data from String to Null on my schema, I have the following error :

{
 "error":
 {
 "message": "Invalid type. Expected Null but got String.",
 "lineNumber": 0,
 "linePosition": 0,
 "path": "d.results[0].dateassigned_x005f_x002b_x005f_2",
 "value": "2023-11-15T13:16:17Z",
 "schemaId": "#/properties/d/properties/results/items/properties/dateassigned_x005f_x002b_x005f_2",
 "errorType": "type",
 "childErrors": []
 }
}

 

It is the opposite... Except on the second error message he recognize the value and not on my first try. 

I don't know what is happening, is anyone able to help me ?

 

Thank you very much.

 

 

  • wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: Parse JSON - Weird Invalid type error

    No, I can't be sure. It probably has to do with when the Schema was copied, some things were null or some things were filled in.

     

    I'm not an expert at how JSON works. I just know how to copy and paste.

     

    It might help if you clean up the response of the HTTP request so that it doesn't include any extra metadata. You would have to change the parse JSON schema, but it might be easier to use.

    wskinnermctc_0-1700581810048.png

    In the HTTP Request Headers put

    Accept application/json;odata=nometadata

     

    See if that will limit the amount of formatting that is returned with the HTTP request.

  • ZekO Profile Picture
    54 on at
    Re: Parse JSON - Weird Invalid type error

    @wskinnermctc 

     

    Thank you for this. It is working fine now.

    Do you know why the type is identified differently ?

  • Verified answer
    wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: Parse JSON - Weird Invalid type error

    First, please rename your SharePoint columns. See my post about SharePoint Column Names and get rid of all the extra special characters encoding in the column name.

     

    You should set the JSON type to string or null. That way it can be either. "type": ["string","null"]

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492