Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Custom Function Param Question

Hi,

I'm wondering if anyone knows a way to send a variable as a parameter into a custom function.

I have a CF like the following....

Name =          userTestFunction()

Parameters =  1

Function =      global.userVariable%1%_Test

In my script I want to pass in a value from a database to complete the variable name in the custom function...

userTestFunction(Database.MyDB.MyField)

Ideally I'd like the value returned from the custom function to be something like this...

global.userVariableA_Test (where 'A' is the value of 'MyField' from the DB lookup)

instead the function treats my input as a string instead of variable and returns...

global.userVariableDatabase.MyDB.MyField_Test

I'm not sure Custom Functions support passing a variable, but if anyone has figured out a way to do it, your insights would be appreciated.

Thanks,

Ryan.

4 REPLIES

Re: Custom Function Param Question

What happens if your function just has %1%?  What does it return?

david

New Member

Re: Custom Function Param Question

I'm not sure what you mean.  %1% is just the place-holder for the parameter w/in the custom function definition.

Re: Custom Function Param Question

Yes, so does your function have a value of A or not?

david

New Member

Re: Custom Function Param Question

The value of the dblookup field (Database.MyTable.MyField) is 'A', but the value of that variable isn't inserted into the %1% parameter, what's put into the parameter is 'Database.MyTable.Myfield'.  So, it treats the database lookup field as a string.

505
Views
0
Helpful
4
Replies
CreatePlease to create content