无网络连接
  1. Home
  2. Ideas

Tip: Call with multiple inputs

作者: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.

    • 3 回复
    1. I
      isedwinr @isedwinr
        2023-01-13 14:33:15.839Z

        Just wanted to post this as a question!
        I tried to set the variable to Call the automation with to JSON content but that did not work work so I will truy and do this now

        1. I
          isedwinr @isedwinr
            2023-01-13 14:41:57.685Z

            works great!

            1. M
              Mark Carpenter @mark.carpenter
                2023-01-13 14:52:25.701Z

                Super, happy it was helpful. I have more tips to post as time allows. If there's anything in particular, I'm happy to start building a list. For my propeller head TA is fun as well as being outstandingly useful so am happy to share what I've learned.