6 Replies Latest reply on Oct 8, 2014 1:23 PM by FileMakerNovice

    Nested list field

    FileMakerNovice

      Title

      Nested list field

      Post

      Hello,
      Is it possible to have lists of lists?
      For instance, say I have a list of EmployeeIDs, CallCount, GradedCount.  I want to pass as one PSoS parameter.

      $listEmpIDs - All employee ids.
      $listCallCount - List of call count per employee id.  
      $listGradedCount - List of calls graded count per employee id.

      I have attempted to define $data as list($listEmpID; $listCallCount; $listGradedCount)

      Basically, I want a simple way to extract the single passed script parameter and was hoping you could nest list fields.  This would allow easier extraction.

        • 1. Re: Nested list field
          philmodjunk

          Your method would need some kind of delimiting value between each list or there will be no way to tell when the values of one list end and the next begin.

          Such as:

          list($listEmpID; "***" ; $listCallCount; "***" ; $listGradedCount)

          But there is also another method for passing multiple values in a script parameter:

          Here's an example from one of my systems:

          "Let ( [ $Message = " & Quote ( "Picture of Customer with Metal is Missing." ) &
                 " ; $WindowName = " & Quote ( "ERROR" ) &
                 " ; $ButtonList = List ( " & Quote ( "Continue" ) & " ; " & Quote ( "Add it" )  & " ) ] ; 1 )"

          In the script, you'd use something such as:

          Set Variable [$Dummy ; value: Evaluate ( Get ( ScriptParameter ) ) ]

          This assigns the value 1 to $dummy, but also creates three variables named $Message, $WindowName and $ButtonList, assigning values to each.

          • 2. Re: Nested list field
            FileMakerNovice

            Nice.  I did not know about the second method that created variables.  I will definitely go that route.  Thanks.

            • 3. Re: Nested list field
              FileMakerNovice

              Hey Phil,
              I attempted to do the same and the PSoS does not appear to be returning the right data.
              Client passes this in as a parameter:
              let([ $start=1; $end=2]; 1)

              PSoS has:
              Set Variable [$dummy; Value:Evaluate(Get(ScriptParameter))]
              Exit Script [ Result: $start &" "& $end]

              When looking at get(scriptresult),it has no data.  Did I miss something?

              EDIT:
              It appears that if I do the same calculation client side only, the variables are created automatically.

              • 4. Re: Nested list field
                philmodjunk

                let([ $start=1; $end=2]; 1)

                passes the value 1 to your script.

                There's quotation marks missing from your script parameter expression. You actually pass text to the script and then Evaluate turns the text into an actual calculation.

                The above example should be:

                "let([ $start=1; $end=2]; 1)"

                And if you want to assign values from the current record to $Start and $End, you might need to use this:

                "let([ $start=" & YourTable::fieldHere & "; $end=" & YourTable::Field2Here & "]; 1)"

                • 5. Re: Nested list field
                  FileMakerNovice

                  Ahhhhh.  I thought the quotes was to make it look pretty or something.  You made me see the light.  Thanks again.

                  • 6. Re: Nested list field
                    FileMakerNovice

                    Hopefully, you have one more second.  How do you pass dates in with this method?  I see the text method above with quote but I can't seem to figure it out with getasdate.

                    EDIT:
                    NM, I'm an idiot.  Quote is what I should have been using there too.