Adding more inputs into Flow Designer Action even with the limit reached

matthew_hughes
Kilo Sage

One thing that I've noticed when creating a Flow Designer Action, there is a limit to the number of inputs that are allowed. 

 

Because it this, it means that I've had to create two separate Flow Designer Actions:

matthew_hughes_0-1769179384042.png

 

matthew_hughes_1-1769179400846.png

 

I was just wondering if anyone has come across this issue before and if there's a way of combining two Flow Designer Actions into one.

 

7 REPLIES 7

Hi @Itallo Brandão Thanks for looking into this.

 

So do I go into a Flow Designer Action and create a new input called 'payload' with a type of JSON and make it mandatory?

 

Are you able to provide an example of how I could update my variables? Some will only get update if the true/false inputs were selected.

Hi Matthew,

You are spot on with your understanding.

1. The Action Setup Yes, go into your Action Inputs and:

  • Create a New Input.

  • Label: Payload

  • Name: payload

  • Type: JSON (or String).

  • Mandatory: Yes.

2. Handling the "Update if True" Logic This is the best part: You handle the logic inside the Flow (before calling the Action). This keeps your Action simple and reusable.

Instead of passing the "True/False" flag to the Action, you simply don't include the field in the JSON if the flag is false. The Action script I provided earlier only updates fields that are actually present in the JSON.

How to implement (Step-by-Step):

Step A: In your Flow, add a "Script" Action (Core > Script) You will use this step to "build" the packet based on your variables.

  • Input Variable: Create one called ritm (drag your Requested Item record here).

  • Script:

(function execute(inputs, outputs) {
    var variables = inputs.ritm.variables; 
    var payloadObj = {}; // Start with an empty object

    // --- LOGIC: Only add to payload IF the checkbox is True ---

    // Example 1: Update Application Name?
    if (variables.update_application_name == 'true') {
        // We only add the 'name' key if the check is true
        payloadObj.name = variables.new_application_name.toString();
    }

    // Example 2: Update Owner?
    if (variables.update_business_owner == 'true') {
        // Map 'u_business_owner' (backend name) to the variable value
        payloadObj.u_business_owner = variables.new_business_owner.toString();
    }

    // ... Repeat this block for your other fields

    // Final Output: Convert the object to a String
    outputs.payload_string = JSON.stringify(payloadObj);
    
})(inputs, outputs);


Step B: Call your Custom Action

  • Add your custom Action to the Flow.

  • In the Payload input, drag the payload_string data pill from the Script Step you just created (Step A).

Why this works: If the user unchecks "Update Description", your script (Step A) will not add the short_description key to payloadObj. When the Action runs, it sees the key is missing and simply ignores that field, leaving the existing data on the record alone.


If this response helps clarify the implementation, please mark it as Accepted Solution.


Best regards,
Brandão.