jak
jak11mo ago

Hey guys! i'm making solid progress on

Hey guys! i'm making solid progress on building out our buildship API but have an issue. I'm working on a workflow with multiple branches, and I'm looking for a way to consolidate data from these branches at the end of the workflow. However, I'm encountering errors when trying to access values from branches that were not executed in the current flow request. Is there a workaround to access variables or data from non-executed branches in Buildship? Ideally, I'd like to retrieve the value from whichever branch was run and use it for further processing. Any advice or suggestions on how to achieve this would be greatly appreciated. In the example below, I need to check to see if the row exists in supabase, if not then i need to create the row (on the branch). The trouble is that further down the workflow, I cant find a way to use the row id from whichever node was run. Thank you!
No description
4 Replies
Gaurav Chadha
Gaurav Chadha11mo ago
Hi @jak , You can access variables from any node and branch if it is added above/before it, it doesn't depend on if it was executed or not, (note: the branches should be connected to the node on which you want to access variable) but in the condition it should find the value (variable) from the executed node to run successfully. To get the supabase row id, you can click on "update output schema" on "get row node result - using the green checkmark"after running test . Which will update the output schema to the result type (array in this case). Then you can update your condition and access the value using variable with dot notation.
No description
No description
jak
jakOP11mo ago
Hi @Gaurav Chadha thanks. However, Whilst i do get a successful response (image 1) and have clicked on "update output schema", I still can't drill into the data (image 2) or use dot notation (image 3) as it results in an error (image 4). Can you spot what i am doing wrong?
No description
No description
No description
No description
Gaurav Chadha
Gaurav Chadha11mo ago
Give the array index as well. check if place[0].id
jak
jakOP11mo ago
magic! this is the danger of making things solo, it's easy to miss the obvious thanks I still have the issue where I need the row id from either the node that reads if the row exists or the node on a branch that creates the node. How might i go about getting the id so i can use it further down the workflow? Solution. I created a node that tries to POST data, if the record already exists in the db then the function does a GET request. in all cases the output is good and no branching needed in buildship