No internet connection
  1. Home
  2. Ideas

Use Inline Function inside Flow: IF or CASE.

By @matty
    2022-09-14 23:14:18.570Z2022-09-15 19:03:43.108Z

    Hi, To be able to use a flow currently have to set a variable as %func%:JsonValue(value,path) first then use the IF actions on the newly assigned variable.

    It would be helpful if there were a way to use %func%:JsonValue(value,path) inside an IF action and skip setting a variable. This would reduce the steps needed to reach the desired flow.

    matty

    Solved in post #4, click to view
    • 4 replies
    1. D
      Daniel Horton @daniel.horton
        2022-09-15 08:50:27.686Z

        Hi Matty,

        This is completely possible. Here is a working example to show you that it is:

        1. M@matty
            2022-09-15 18:57:32.635Z2022-09-15 19:27:16.928Z

            Hi Daniel,

            Okay, I see that it is possible in CASE; however, in the IF action, I was hoping we could do this without setting the Variable "TheName" First (For a lot of IF comparisons this could be time-consuming to create the variable each time).

            Instead, I would be helpful to freely type the inline function into the If Block to allow for options like "Is a Valid Email Address with an MX Record", "Is Blank" or "Is Not Blank" etc. A timesaving example is below where we check for the first email address in a JSON Value and then check that it is a valid email address with an MX record

            Example: %func%:EmailAddress(%func%:JsonValue(%JSON%,EMAIL)) Is a Valid Email with an MX Record.

            Perhaps this ability could work similarly to how TA 5 presents a drop-down when editing within the "Set Variable" Action:

            Thanks,

            Matty

          • D
            In reply tomatty:
            Daniel Horton @daniel.horton
              2022-09-16 10:37:52.327Z2022-09-16 10:43:56.084Z

              Thank you, that is indeed something you are currently unable to do. We will allow for the variable selector to be editable meaning you can provide inline function calls here. This will be available within a future update.

              Reply2 LikesSolution
              1. Progress
                with doing this idea
              2. M
                @matty
                  2022-09-20 21:14:56.002Z

                  I just tested the pre-release 5.0.871.2 that includes this new improvement and it is working great!

                  An automation that used to be over 80 lines is now just 44 lines! I no longer need to define all the redundant variables just to put them into an IF action. Now I can just retrieve JSON values using the inline functions right within IF actions and conditions!

                  Thank you!