Issues with RPC List Data Extraction and Dynamic Array Use in Custom App

Hello Make Community,

I am working on a custom app integration and facing a couple of issues that I hope to get some guidance on:

  1. RPC List Data Extraction:

I am trying to extract data from an RPC list, specifically the labels or types. Below is the response I’ve written in the RPC:

"response": {
    "iterate": "{{extractPropertyNames(body, 'Priority.OData')}}",
    "output": {
        "label": "{{item}}LABEL",
        "name": "{{item}}NAME",
        "value": "{{item}}VALUE",
        "type": "{{item.type}}"
    }
}

However, I’m unsure if this is the correct way to retrieve the LABEL or TYPE. How can I accurately get data from an RPC list?

  1. Dynamic Array for Creating a New Customer in ERP:
    I’m using an array to create a new customer in my ERP system. I retrieve the labels from the ERP form using RPC and want to dynamically add more columns (from the RPC List) to be added/updated. Here is an example of a non-dynamic body request:
"body": {
    "EMAIL": "{{parameters.customer.email}}",
    "CUSTDES": "{{parameters.customer.name}}",
    "STATEA": "{{parameters.customer.address.statea}}",
    "ZIP": "{{parameters.customer.address.zipcode}}",
    "PHONE": "{{parameters.customer.phone}}",
    "ADDRESS": "{{parameters.customer.address.street}}"
},
"response": {
    "iterate": "{{parameters.contacts}}",
    "output": "{{item}} + {{item.value}} + {{item.name}}"
}

How can I make this request dynamic so it automatically includes all the data fields from the module, considering the data is in an array?

I would appreciate any insights or examples of how to handle these scenarios.

Thank you!


image

see attached, hope its help more with me questions :slight_smile:

Welcome to the Make community!

You can try this to return dynamic collection properties in the response:

    "{{...}}": "{{body}}",

For more information, see https://docs.integromat.com/apps/other/processing-of-json-strings-inside-a-json-object

You can use this for dynamic fields,

[
    "rpc://nameOfMyRemoteProcedure"
]

For more information, see Dynamic Fields RPC - Make Apps

2 Likes

Hello,
Thank you for your response.

I already use the RPC, and its work.

and in the MAPPABLE PARAMETERS in the module:

[
	{
		"name": "contacts",
		"spec": [
			{
				"name": "email",
				"type": "select",
				"label": "Email",
				"required": true,
				"options": {
					"store": "rpc://RPC",
					
					"nested": [
						{							
							"label": "{{parameters.contacts.email}} {{parameters}} {{item}}",
							"type": "text",
							"required": true
						}
					]
				}
			}
		],

		"type": "array",
		"label": "Contacts",
		"mode": "choose"
	}
]

but its not work, I cant take the label from the RPC (instead the email)
and what happens, that the body is always with “email” instad of “CUSTDES” in that example:

wrong:

[
    {
        "email": "CUSTDES",
        "undefined": "MYNAME"
    },
    {
        "email": "CUSTNAME",
        "undefined": "12345"
    }
]

good:

{
    "CUSTDES": "MYNAME",
    "CUSTNAME": "12345"
}

I don’t think you can use dynamic labels like that. Try creating another RPC to get the nested field with dynamic label.

{
  "name": "email",
  "type": "select",
  "label": "Email",
  "required": true,
  "options": {
    "store": "rpc://RPC",
    
    "nested": "rpc://GetUserEmailField"
  }
}
2 Likes

Maybe this will explain what i need better :slight_smile:


I need those will be dynamic from the array
The body change depends on the module:

Hope anyone knows the solution :slight_smile:
I know Monday.com use it: