Integromat Make, Send dynamically generated form_data to API in a module

361 Views Asked by At

I am making a custom app in make that sends data to our system. I am trying to send custom data to our system, I could able to generate dynamic mapping parameters using "RPC" I could able to see them in the UI in the scenarios.

enter image description here

["rpc://GetCustomFields"]

But I could not able to send the form the module to our system.

Things I tryed

  1. Make an RPC which generates code that matchs the body as shown in the documentation and place that RPC in the body of the module

    [ { "custom_field01": "{{parameters.custom_field01}}" } ]

Use that RPC to generate dynamic code to get data from the custom fields

{
    "url": "/test_url",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "JWT token"
    },
    "body": {
    "standard_fields":{
    "FIRSTNAME":"{{parameters.FIRSTNAME}}",
    "LASTNAME":"{{parameters.LASTNAME}}",
    "SALUTATION": "{{parameters.SALUTATION}}",
    "TITLE": "{{parameters.TITLE}}",
    "COUNTRY": "{{parameters.COUNTRY}}",
    "CITY": "{{parameters.CITY}}",
    "ZIP": "{{parameters.ZIP}}",
    "ADDRESS": "{{parameters.ADDRESS}}",
    "ORGANIZATION": "{{parameters.ORGANIZATION}}"
    },
    "custom_fields":"rpc://sendCustomFields"
    },
    "response": {
        "output": "{{body}}"
    }
}

But Unfortunately what I get in request call is this

{
    "custom_fields": "rpc://app%43randomText-8jkh96@1/sendCustomFields",
    "standard_fields": {
        "SALUTATION": "Herr"
    }
}
  1. Try to build custom ILM function to generate dynamic code

    function helperSendCustomFields() { let customField = {}; customField.custom_field01 = "{{parameters.custom_field01}}"; return customField; }

In module connection

{
    "url": "/test_url",
    "method": "POST",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "JWT token"
    },
    "body": {
    "standard_fields":{
    "FIRSTNAME":"{{parameters.FIRSTNAME}}",
    "LASTNAME":"{{parameters.LASTNAME}}",
    "SALUTATION": "{{parameters.SALUTATION}}",
    "TITLE": "{{parameters.TITLE}}",
    "COUNTRY": "{{parameters.COUNTRY}}",
    "CITY": "{{parameters.CITY}}",
    "ZIP": "{{parameters.ZIP}}",
    "ADDRESS": "{{parameters.ADDRESS}}",
    "ORGANIZATION": "{{parameters.ORGANIZATION}}"
    },
    "custom_fields":"{{helperSendCustomFields()}}"
    },
    "response": {
        "output": "{{body}}"
    }
}

what I get in the request call is

{
    "custom_fields": {
        "custom_field01": "{{parameters.custom_field01}}"
    },
    "standard_fields": {
        "SALUTATION": "Herr"
    }
}

Please any idea's to get data from the dynamically generated form in Make application

1

There are 1 best solutions below

0
Karri Aravind On

I finally found solution, I requested IML functions which was accepted and then I used it dynamically generate the body of the module

for example, I created a method in IML

function generateBodyForCreateContact(parameters) {
    return requiredBody;
}

parameters are the data available in bundle and use it in the module

"body": "{{generateBodyForCreateContact(parameters)}}"

Finally now I have dynamic body which changes with the data inputted from the other make events