Ray Deck
Ray Deck
Xano Expert
 · Lead Mentor @ statechange.ai

Best practice to pass/map variables to custom function

I'm sometimes dealing with situations when I have a few custom functions nested under each other. Let's say I get a user profile data (30+ key-value pairs) from db in the first one, but then I need to use these same keys-values in a custom function underneath. What would be the best practice to pass them to that function?

1. Pass just the db entry id and pull data from db again in sub-fuction? Seems wrong.
2. Add inputs for sub-function as a database link (quick and easy) and then map variables to from function 1 to function 2? (seems like this can only be done manually for each key-value)
3. Pass an object to function 2 and add a schema that is “table reference”? I did it but it still involves manual mapping of every field.

2 replies