Select part of the msg.payload properties

From the msg.payload that I previously filtered I am only interested in the properties name and biography. In a Change node I have made three deletes of the properties that don't interest me but it doesn't work. How can I solve it

{
    "name": "Janese Swanson",
    "biography": "American software developer, Swanson is famous for founding Girl Tech, a company for making technology more interesting to women. At the age of 15, she started working as a salesperson  in the television and sound system department at Sears. Her experience in sales came in handy when she became the manager of the technology department at a store called My Child’s destiny. She did her certifications in computers from Berkeley and a Ph.D before creating Girl Tech.",
    "Files::file": "https://xxxxxxxxxxxxx.com/Streaming_SSL/Additional_1/DFFCE0F44C07A474B76915A9D0349514AEEF938D053D8C3798DBB397B8A98ED9.jpg?RCType=EmbeddedRCFileProcessor",
    "Settings::server": "",
    "Settings::version": "1.0.0"
}

That won't work.

There’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

https://nodered.org/docs/user-guide/messages

Then use the copy path button and paste the path into the switch delete line.

Why do you want to go to the effort of deleting them?

I program with FileMaker and last month I discovered Node-Red also had news of node-red-contrib-filemaker. Basically I am testing how I could import and export data through MQTT to other applications.

@Colin The find that I do to the FileMaker Api returns I only need name and biography. That's why I delete the ones I don't use from the same block.

{
    "layout": "people",
    "query": {
        "name": "janese"
    },
    "find": {
        "dataInfo": {
            "database": "FileMaker-of-Things",
            "layout": "People",
            "table": "People",
            "totalRecordCount": 15,
            "foundCount": 1,
            "returnedCount": 1
        },
        "data": [
            {
                "fieldData": {
                    "name": "Janese Swanson",
                    "biography": "American software developer, Swanson is famous for founding Girl Tech, a company for making technology more interesting to women. At the age of 15, she started working as a salesperson  in the television and sound system department at Sears. Her experience in sales came in handy when she became the manager of the technology department at a store called My Child’s destiny. She did her certifications in computers from Berkeley and a Ph.D before creating Girl Tech.",
                    "Files::file": "https://**************.com/Streaming_SSL/Additional_1/0FD82DE24F273556DFE1761FD5BFC55749C2331653E37A27EE7C8A4A03A12E0C.jpg?RCType=EmbeddedRCFileProcessor",
                    "Settings::server": "",
                    "Settings::version": "1.0.0"
                },
                "portalData": {},
                "recordId": "7",
                "modId": "7"
            }
        ]
    }
}

@Steve-Mcl The path I use is the same that I would use in FileMaker, which I have not taken into account that with the set I have already restricted the msg.payload.The right thing to do is Delete: msg.payload["Files::file"]

I don't know if there is another way to do it, but I thought that with the Change node it would be useful.

Be very careful if you delete entries from an existing object. Remember that javascript uses pass by reference, so when you delete properties from an object you may be deleting them from the original instance of that data, not just what you might think is a copy that you are passing down the chain. If that is not a problem in this case then ok.

This is not the case. Thank you for the clarification

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.