cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Error in the HTTP Body when an Array is added as a value

 Hello Power Automate Community! 

 

Running into an error where the flow where it's stating my JSON is invalid within the HTTP request. When I add an array into the body of the HTTP it flags this error. When I remove the array, it works perfect however missing the assignee when viewed in iAuditor. 

 

Does anyone know how to add an array within the body where the flow checker will accept it? 

 

HTTP Body: 

 

{
  "audit_id": @{body('Get_a_specific_audit')?['audit_id']},
  "description": "Remove safety hazard",
  "priority": "30",
  "status": "0",
  "due_at": @{addDays(body('Get_a_specific_audit')?['audit_data']?['date_completed'],3)}
  "assignees": [
       {
          "type": “user",
           "id": "@{body('Get_a_specific_audit')?['audit_data']?['authorship']?['owner_id']}"
       }
   ]
}

 

 

HTTP Action within the Flow:

 

JSONBodyError.png

 

Error Message:

 

JSONerror.png

 

iAuditor Action API Documentation:

Action_API_Documentation.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Error in the HTTP Body when an Array is added as a value

Wait, wait, wait...

there is a comma missing just after "due_at" value!!!!!

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

5 REPLIES 5
Highlighted
Dual Super User III
Dual Super User III

Re: Error in the HTTP Body when an Array is added as a value

Hi!

Did you try to add

@{body('Get_a_specific_audit')?['audit_data']?['authorship']?['owner_id']}

without the double brackets?

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Dual Super User III
Dual Super User III

Re: Error in the HTTP Body when an Array is added as a value

Hi again!

I realized double quotes just before user are not the regular ones:

"type": “user",

 

I would try eith this instead:

"type": "user",

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Frequent Visitor

Re: Error in the HTTP Body when an Array is added as a value

@efialttes I updated the quotation marks throughout and still no luck. In addition, I removed the quotations in 

 

@{body('Get_a_specific_audit')?['audit_data']?['authorship']?['owner_id']}

 

Here's what I updated:

 

{
  "audit_id": @{body('Get_a_specific_audit')?['audit_id']},
  "description": "Remove safety hazard",
  "priority": "30",
  "status": "0",
  "due_at": @{addDays(body('Get_a_specific_audit')?['audit_data']?['date_completed'],3)}
  "assignees": [
       {
          "type": "user",
           "id": @{body('Get_a_specific_audit')?['audit_data']?['authorship']?['owner_id']}
       }
   ]
}

 

Highlighted
Dual Super User III
Dual Super User III

Re: Error in the HTTP Body when an Array is added as a value

@yeamans 

Two suggestions:

1.- can you share the JSON schema?

2.- can you try with an empty array, just for troubleshooting purposes?

{
  "audit_id": @{body('Get_a_specific_audit')?['audit_id']},
  "description": "Remove safety hazard",
  "priority": "30",
  "status": "0",
  "due_at": @{addDays(body('Get_a_specific_audit')?['audit_data']?['date_completed'],3)}
  "assignees": []
}

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Dual Super User III
Dual Super User III

Re: Error in the HTTP Body when an Array is added as a value

Wait, wait, wait...

there is a comma missing just after "due_at" value!!!!!

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (5,957)