Table empty item, but present in json

Describe the issue/error/question

Hi,

ihm querying an api, and extracting data. Something strange is happening. In Tableview it states “item empty”, in json I can see it.


What is the error message (if any)?

Please share the workflow

{
“nodes”: [
{
“parameters”: {
“requestMethod”: “POST”,
“url”: “=https://ec.europa.eu/eures/eures-apps/searchengine/page/jv-search/search”,
“jsonParameters”: true,
“options”: {
“bodyContentType”: “json”,
“fullResponse”: true,
“splitIntoItems”: true
},
“bodyParametersJson”: “{"keywords":[],"publicationPeriod":null,"occupationUris":[],"skillUris":[],"requiredExperienceCodes":[],"positionScheduleCodes":[],"sectorCodes":[],"availableLanguages":["de"],"educationLevelCodes":[],"positionOfferingCodes":[],"locationCodes":["de"],"euresFlagCodes":[],"otherBenefitsCodes":[],"requiredLanguages":[],"resultsPerPage":50,"sortSearch":"BEST_MATCH","page":1,"sessionId":"hnqul39ibz5lnhqdn8fxs"}”,
“headerParametersJson”: “{ "Cookie": "EURES_JVSE_SESSIONID=318DE66FD13CB7DA5602172159EB4F57; XSRF-TOKEN=57a1fbbf-1339-450b-a67a-8f624888befb; cck1=%7B%22cm%22%3Atrue%2C%22all1st%22%3Afalse%2C%22closed%22%3Atrue%7D","X-XSRF-TOKEN": "57a1fbbf-1339-450b-a67a-8f624888befb"}”
},
“name”: “Search Results - HTTP Request”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 1,
“position”: [
440,
800
]
},
{
“parameters”: {
“functionCode”: “// Code here will run once per input item.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.functionItem\n// Tip: You can use luxon for dates and $jmespath for querying JSON structures\n\n// Add a new field called ‘myNewField’ to the JSON of the item\n//item.myNewField = ID;\n\n// You can write logs to the browser console\n//console.log(‘Done!’);\n\nreturn item.body;\n”
},
“name”: “Split jobs - FunctionItem”,
“type”: “n8n-nodes-base.functionItem”,
“typeVersion”: 1,
“position”: [
700,
540
]
},
{
“parameters”: {
“functionCode”: “return item.numberRecords;”
},
“name”: “FunctionItem”,
“type”: “n8n-nodes-base.functionItem”,
“typeVersion”: 1,
“position”: [
920,
540
]
}
],
“connections”: {
“Search Results - HTTP Request”: {
“main”: [
[
{
“node”: “Split jobs - FunctionItem”,
“type”: “main”,
“index”: 0
}
]
]
},
“Split jobs - FunctionItem”: {
“main”: [
[
{
“node”: “FunctionItem”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version:0.188.0
  • SQLite
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [npm]:

Hi @Kool_Baudrillard
You only return the value of this field now. That will not work.
try returning this for example:
{“number of records”:item.numberRecords}

1 Like

Hi, not getting it.

Should it be place in the function node and how?

the return line you have right now is returning just the value. This does not work as n8n needs objects to actually be able to show something as the item.

So replace: return item.numberRecords
With: return {“number of records”:item.numberRecords}

Also it might be better to use the Set node for stuf like this. Especially with the new drag and drop functionality you can easily select the field you want and when turning on “keep only set” you will remove all other fields.

1 Like

Ahhhh, thank you! I went with the set node. <3

1 Like