In the above mentioned method we need to get the output of first node. so we are directly fetching from database. we are not using any backend API. Please help us how to fetch the data using this method to pass to the parameter.
What you need to do inside that code is to make the same query to get that table, but only 2 fields need to stay, one name and one value. Which will be the name shown and the value that is behind it so in your case. rpa_name is the name and rpa_id is the value.
This list of names and values is what should be returned by the loadOptions function. You can simply rename that btw. to something like getRpaInstances for example. Make sure to also change it at the properties set up.
Hi @BramKn / @marcus
Thanks for your suggestion we are trying that. But we are confused how we can write the query in items variable. or Please suggest us where we can write query. We need to fetch data from database. We are confused where we can write. I am attaching the screenshot of function for reference. We are getting an error- getinputdata doesnot exits.
I see you were able to use loadOptions to list some dynamic options. Inside your loadOptions method you do not have access to getInputData() by design. So you cannot use your input data as an options list, because in n8n any data can be passed into your InstanceName node, not just the output of your other custom node.