xbommer07
xbommer074d ago

Reference a specific value in JSON output from Firebase query

I have a node that queries a firebase collection. it returns the results as a document body which is JSON formatted. { "Authentication": "Value", "ConnectionID": "Value", "Location": "LocationID" } I need to use the authentication value in the next node but do not know how to reference only the authentication value. in javascript I would say {{ Nodename.data.authentication }} How do I reference this? I even tried some of the JSON nodes but still no luck.
4 Replies
AI Support
AI Support4d ago
AI Support Bot Information
<@819257502801330196> you can react on the relevant answer (message) with a ✅ in this thread when you think it has been solved, by the bot or by a human! Anyone can react on this message with a ❌ if the GPT bot is unhelpful or hallucinating answers. Please note: Team members will review and answer the questions on best efforts basis.
AI Support
AI Support4d ago
AI Response
To reference the "Authentication" value from the JSON response of one node to use in the next node in your BuildShip workflow, you should use the context variable path. It seems that you're almost there with the JavaScript-like syntax. In the context of BuildShip, you can access the data returned from a previous node like so: - Use the context variable to refer to the output of the previous node. The usual pattern is ctx['nodeName']['outputField']. For your specific case, it appears you have a JSON object with the structure:
{
"Authentication": "Value",
"ConnectionID": "Value",
"Location": "LocationID"
}
{
"Authentication": "Value",
"ConnectionID": "Value",
"Location": "LocationID"
}
You can access the "Authentication" value like this: - If the node's name is Nodename, then the syntax would be ctx['Nodename'].Authentication. Ensure that Nodename is exactly the name or identifier given to the node whose output you want to use. Replace Nodename with the actual identifier for that node in your workflow. You access the values in the structure through the context variable, which is a standard way in BuildShip to handle node data. If this is still not resolving the issue, you may consider using JSON manipulation nodes or reaching out directly to BuildShip support for more guidance on your specific use case.
BuildShip AI Support
xbommer07
xbommer07OP4d ago
This is the exact output format. [ { "id": "FwzmcJPXTxduI9hxHR94", "data": { "Authentication": "value", "ConnectionID": "Value", "Location": "LocationID" } } ]
Colin
Colin2d ago
@xbommer07 It looks like you're outputting an array, so you may need to do Nodename[0].data.authentication

Did you find this page helpful?