Format date in array of collections

Hello! I develop a custom app which has an action, the input data of which includes an array of collections. The collection includes “dueDate” and “amount” properties.

This is how the field is described in the mappable parameters.

[
  {
    "name": "paymentSchedule",
    "type": "array",
    "spec": {
      "type": "collection",
      "spec": [
        {
          "name": "dueDate",
          "type": "date",
		      "label": "Payment due date"
        },
        {
          "name": "amount",
          "type": "integer",
		      "label": "Payment amount in cents"
        }
      ]
    },
    "label": "Payment schedule"
  },
]

In the “Best practices” docs section I found that fields with “date” type should be transformed with formatDate function. There are examples to format a single field, however I haven’t found any examples of how to transform fields of objects in array. Is there a way to do this without a custom IML function?

Ref https://docs.integromat.com/apps/best-practices/processing-of-input-parameters#date-parameters

From your link, it looks like the formatDate function is only called in the Communication portion of the outgoing request to the external service. How does your app look like for Communication? You don’t use formatDate in the input parameters.

2 Likes

Hello Alex,

You will need to implement a custom IML function, examples of implementation:

Since custom IML functions are now temporarily disabled in all accounts, you will need to contact Support to assist you. Support will help to deploy your new or updated custom IML function on your behalf.

2 Likes