No internet connection
  1. Home
  2. Ideas

Tip: Call with multiple inputs

By Mark Carpenter @mark.carpenter
    2021-07-17 12:29:26.223Z2021-07-18 09:57:50.978Z

    Just a tip regarding how calls with multiple variables can be implemented. In this example, we use the 'spirit' of key : value pairs to pass two variables containing strings and one variable containing a JSON record extracted from a table:

    NoteResult = Call Process dbo.Notes Row ( MakeModel:%MakeModel%, Channel:%Channel%, %NoteRow%)

    where
    %MakeModel% is a string
    %Channel% is a string
    %NoteRow% is a JSON record extracted from a SQL table

    To extract the data in the called Automation is really straight forward. Extract from %msg_body% as follows:

    • Extract Field %MakeModel% contents by looking for key MakeModel: and extracting until the comma
    • Extract Field %Channel% contents by looking for key Channel: and extracting until the comma
    • Extract any field within %NoteRow% JSON 'Extract Field Json Path' and look for the key within the JSON

    To pass multiple JSON records, assign each JSON to a key in the call, use a separator (some character that won't show up in the JSON record), extract each JSON and carry on extracting the fields.

    • 0 replies