Using the "pipe" separater, you'd need an expression like: TOC::FIELD & "|EMPLOYEE"
I prefer to pass a list of parameters in this fashion: List ( TOC::Field ; "Employee" )
Extracting the individual values from within the script is a touch simpler:
Getvalue ( Get ( ScriptParameter ) ; 1 ) will return the TOC::Field parameter
GetValue ( Get ( ScriptParameter ) ; 2 ) will return the second parameter, the literal text "Employee".
Note that in either fashion, you sometimes have to coerce non text data types inorder to use the values successfully in your script.
GetAsNumber ( Getvalue ( Get ( ScriptParameter ) ; 1 ) ) or
getAsDate ( Getvalue ( Get ( ScriptParameter ) ; 1 ) )
to give two examples of coercing the data type.
Thanks philmodjunk... i'm closer but still having some difficulty. at least i can specify the multiple parameters now! as you pointed out, my problem now is evaluating them. the first parameter is a container field which has a picture (png file) in it. i have an expression to see if the picture in this container field matches one stored in a global field. it doesn't seem to evaluate correctly simply using "getvalue" (this is how i have it set up inside the "if" statement: GetValue ( Get ( ScriptParameter ) ; 1 ) = GraphicsElements::g_Graphics  ) and i couldn't find a "getaspicture" function (or equivalent) to place in front of it. is there such a thing? how would you extract the container field's contents such that you could use it in an: "if "the contents of the container field passed in the script parameter" = "the global container field" " kind of way?
ooops... disregard that last post. i just discoverd that i had disabled some other script steps that made it appear as though it was not evaluating correctly. my bad... everything is working fine. this is an awesome new technique you have tough me. thanks!!!
hi philmodjunk... i was hoping you can answer a follow up question for me? i am passing a script parameter as you suggested in a list and it looks like this:
List ( contacts_CONTACT_RELATIONSHIPS_Employees::ArrowOrPlusSign ; "Employee" )
to evaluate it i have an expresssion which looks like this:
GetValue ( Get ( ScriptParameter ) ; 1 ) = GRAPHIC_ELEMENTS::g_Arrows  and GetValue ( Get ( ScriptParameter ) ; 2 ) = "Employee"; "NavigateToEmployee"
it worked great! the problem now is that i am passing a similarly formatted parameter (List ( products_PRODUCTS_LiveSearch::Match_B ; "Products" ) and i am trying to use the "count" function but i cannot get it to evaluate correctly (or at all... it displays a question mark in the dialog i am using to troubleshoot. i have tried the following formats to get a value and none of them are working:
Count ( GetField ( GetValue ( Get ( ScriptParameter ) ; 1 ) ) )
Count ( GetField ( "\"" & GetValue ( Get ( ScriptParameter ) ; 1 ) & "\"" ) )
Count ( GetField ( GetAsText ( GetValue ( Get ( ScriptParameter ) ; 1 ) ) ) )
Count ( GetField ( "\"" & Get ( ScriptParameter ) & "\"" ) )
Count ( GetField ( Get ( ScriptParameter ) ) )
**Count ( GetValue ( Get ( ScriptParameter ) ; 1 ) )
**won't allow this expression. error message says "In the function Average, Count, Extend, GetRepetition, Max, Min, NPV, StDev, Sum, GetSummary or GetNthRecord, an expression was found where a field alone is needed."
the straightforward expression: Count ( products_PRODUCTS_LiveSearch::Match_B ) works fine.
you will notice that some of the expressions i tried don't use get value because i also tried passing a single parameter without using the "list" function to see if that helped but to no avail.
any thoughts about how to format this properly?
The error message explains the issue. Count only works with direct references to a field or fields. Thus, GetField can't be used as a parameter here.
What you can do, is pass the count as the parameter instead of or in addition to the field name.
Put Count ( products_PRODUCTS_LiveSearch::Match_B ) as either the parameter or a member of the parameter list and then you can use one script to count values in different fields as controlled by the script parameter expression.
judging by the speed of your reply, that must have been an obvious alternative, but i would have worked all night re-writing that expression 300 different ways before it would have ocurred to me (if at all) to do it as you suggested. thank you for giving my evening back to me!!!
hey philmodjunk, i know you are probably tired of answering questions about script parameters but i have encountered another problem.
if, for example, i am passing 4 parameters in a value list and let's say the first field i am passing (the first scrip paramteter) is empty, then what is happening inside the script is that getvalue ( get ( scriptparameter ) ; 1 ) gives me the value of the field that was passed as the 2nd sript parameter, and so on down the line. such that getvalue ( get ( scriptparameter ) ; 4 ) returns nothing at all.
is there a solution to this problem or a workaround that you could suggest? would the "pipe" method of passing multipe parameters avoid this glitch? is so, would you be able to outline the method to extract the different parameters... i don't really know much about how to parse text strings like that. any thoughts would be greatly appreciated. thanks!
"the first field I am passing (the first script parameter) is empty"
is not the same thing as
"the first field I am passing (the first script parameter) is missing".
GetValue (Value1 ; value2 ; Value 3 )
will not deliver the same parsing as
Get Value ( "" ; Value2 ; Value3 )
Can you check that you are always passing the same number of values, in the same order, even if one is empty?
let me try to clarify what i am doing. i am passig a scrip parameter that looks like this:
the script is being launched by the user clicking on a button that is inside a portal row (the portal is displaying items from the table "invoices_PRODUCTS_LiveSearch". so as long as the three fields which are being passed as the first three script parameters are not empty, everything works fine. but if the field which is identified by the third parameter ( invoices_PRODUCTS_LiveSearch::Qty_In_Stock ) is empty, then getvalue ( get ( scriptparameter ) ; 3 ) returns the text string "Invoices_QuickEntry" which was the 4th parameter, and getvalue ( get ( scriptparameter ) ; 4 ) doesn't return anything. so for some of the items in the portal the script works fine, and for others (without a value in all three fields) it fails.
i am not familiar with the format you showed: "getvalue ( value1 ; value2 ; value3 )". does that return all the values separated by a semi-colon or as repeating fields or something? i only know how to use getvalue ( valuelist ; 1* ) (* or 2, 3, 4 etc) to get one value at a time.
does that help clarify the trouble i am having?
it just occurred to me that i may be using the wrong language to describe this. when i say "third script parameter", perhaps i should be saying the third value in the value list being passed as the script parameter. does that make more sense?
"i am not familiar with the format you showed: "getvalue ( value1 ; value2 ; value3 )" - sorry - my mistake (too late at night) your understanding is correct. I should have said 'List ("" ; Value2, Value3 )..etc in my example.
The terms you used to describe it were spot on - no confusion there. If it is any consolation, I too would have expected your List and GetValue pairing to work.
Case ( invoices_PRODUCTS_LiveSearch::Qty_In_Stock = "" ; "" ; invoices_PRODUCTS_LiveSearch::Qty_In_Stock ) ;
If any of the others could be empty then you could add a similar statement to their lines - but you may as well try it with one, on a portal row where only that applies.
thanks sorbsbuster, i gave your suggestion a shot but, unfortunately, it returns the same result. i even tried a simplified version. i passed the following as the script parameter:
and, unfortuantely, it behaves the same way. meaning that when i tried to evaluate the 4th parameter i get nothing but if i try to get the first parameter (using getvalue ( get ( scriptparameter ) ; 1 ) ) i get the text string "Invoices_QuickEntry" that was the 4th "value". i think filemaker just ignores the empty "values" and shifts the others up in the queue.
i am going to try passing everything as text strings as follows:
and extract using getfield ( getvalue ( get ( scriptparamter ) ; # ) ) instead and see if that helps.
i am still curious about how people pass and extract multiple parameters using the "pipe" method if you or anyone uses that technique i would love some information. thanks again.
What happens if you make the expression:
Case ( invoices_PRODUCTS_LiveSearch::Qty_In_Stock = "" ; "¶" ; invoices_PRODUCTS_LiveSearch::Qty_In_Stock ) ;
EDIT: tried it - still the (amazing) same result. But if I change it for
Case ( invoices_PRODUCTS_LiveSearch::Qty_In_Stock = "" ; "Is Empty" ; invoices_PRODUCTS_LiveSearch::Qty_In_Stock )
...for example, it works fine. You could check for that return in the next step of your script. Not as I would have expected, by any means.
ahhh... of course! that's a very good idea. thanks for pursuing this unusual problem. in the meantime, i was also able to try passing the parameters (or values) in quotation marks and extracting them with the "getfield" function and that avoids the problem too. not sure really what the advantages or disadvantages to each method would be, but at least now i have 2 to choose from... much better than none! thanks!!
Advantages, to me, of the List ( ; ; )-GetValue ( ; x ) combo is that it is immediately intuitive (present post excepted), and completely scaleable. I used to use the pipe-passing in the old days, and I wouldn't choose to go back.