Make Apps
Search
K

Dynamic Fields RPC

This RPC is used to generate dynamic fields inside a module. You can use this feature for both parameters and interface.
Loading fields from a remote server is as easy as adding a couple of properties to output. The only thing you need to modify them the way, that they would match the syntax of App Builder.
Pay close attention to the type. For example, Make doesn't accept "type": "string". In this case, you need to change it to "type": "text".
You should properly convert field types between your service types and Make types. One of the ways to resolve it is to use Custom IML Functions. Example of such custom IML function can be found here.
Don't forget to specify name for a field. Otherwise, you will not be able to access it in the communication of a module.
The rest of the properties (like options, default, nested, etc.) are also available and can be used according to the selected parameter type.
The only difference is that instead of creating parameters manually you create dynamic parameters. It's like a scenario in Make. You set it up once and the rest of the time it works on its own.
{
"response": {
"iterate": "{{body}}",
"output": {
"name": "{{item.key}}",
"label": "{{item.label}}",
"type": "text",
"required": "{{item.isRequired == 1}}"
}
}
}
Examples:
Example 1
Example 2
Example 3
Usage of RPC for a module with only dynamic parameters:
[
"rpc://nameOfMyRemoteProcedure"
]
Please note, that you might need to implement custom IML function, if the service types of fields don't match with Make types. You can find an example custom IML function here.
Usage of RPC for a module with available additional dynamic parameters, e. g. custom fields:
[
{
"name": "defaultField",
"label" : "Default Field",
"type": "text"
},
"rpc://nameOfMyRemoteProcedure"
]

Usage of select parameter with nested dynamic parameters under a specific option:

[
{
"name": "param",
"label": "Parameter",
"type": "select",
"options": [
{
"label": "Option 1",
"value": 1,
"nested": "rpc://NameOfMyRemoteProcedure"
}
]
}
]