FINAL EDIT: I’ve fixed the two issues described below, but am now faced with a final one at the last node, HTTP Request to WP. It says, “The resource you are requesting could not be found.”
I’m wondering if my JSON in the Edit Fields Back to WP node is structured correctly. I’m thinking it might have something to do with the ID field.
ERRORS FIXED:
- by removing the opening and closing square brackets in the Edit Fields Back to WP node but I then discovered the merge node is not working correctly.
- I changed the Store ID data type in the Edit Fields Gsheet node to String to match the WP data type.
Describe the problem/error/question
The ‘JSON Output’ in item 0 does not contain a valid JSON object
I’m trying to update a custom post type on my WordPress website with Google Sheets data. Everything seems to work** up to the Edit Fields Back to WP node. The assignment of the placeholders appears to work in the result pager in the Edit Fields Back to WP node, but the actual output throws the above error.
In the merge node I’m enriching output 2 and when there is a clash of data I’m preferring input 1. I tested the merge by adding some a’s to the beginning of an email address for a record in Google Sheets.
Store ID | Business Name | Phone | Date Created | F | address | |
---|---|---|---|---|---|---|
1188 | 5 Star Custom Portable Buildings | (205) 339-3518 | aaaaa[email protected] | 11/03/2022 12:28:19 PM | 6602 McFarland Blvd, Northport, Alabama, 35476 | |
The last record in the JSON output of the Merge node does not reflect that change. Here’s the last page of that output:
[
{
"Store ID2":
"158",
"Business Name":
"BackYard Essentials",
"Phone":
"478-954-5598",
"Email":
"[email protected]",
"address":
"310 General Courtney Hodges Blvd, Perry, GA 31069, USA",
"id":
4612
},
{
"Store ID2":
"1014",
"Business Name":
"American-Structures II LLC",
"Phone":
"800-716-5988",
"Email":
"[email protected]",
"address":
"2002 U.S. 78, Monroe, GA 30655, USA",
"id":
4611
},
{
"Store ID2":
"203",
"Business Name":
"American-Structures",
"Phone":
"800-716-5988",
"Email":
"[email protected]",
"address":
"3121 State Hwy 11, Mansfield, GA 30055",
"id":
4610
},
{
"Store ID2":
"157",
"Business Name":
"Albany Auto Center",
"Phone":
"229-432-7020",
"Email":
"[email protected]",
"address":
"3115 Sylvester Rd, Albany, GA 31705, USA",
"id":
4609
},
{
"Store ID2":
"1188",
"Business Name":
"5 Star Custom Portable Buildings",
"Phone":
"205-799-7090",
"Email":
"[email protected]",
"address":
"6602 McFarland Blvd, Northport, Alabama 35476, USA",
"id":
4608
}
]
Here is my updated workflow:
Please share your workflow
Share the output returned by the last node
Here is a screenshot of the Edit Field WP node:
and the Edit Field Gsheet node:
Information on your n8n setup
- n8n version: 1.59.3
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Cloudron
- Operating system: