Hello,
I’m trying to create custom workflow action. I need to send enrolled records “hs_object_id” and internal value of a selected input property “propertyName”. I’m attaching the payload that I’m sending via postman. Can anyone please guide me here how I can send those data to the endpoint.
Thanks
```
{
“actionUrl”: “**”,
“objectTypes”:[
“CONTACT”
],
“published”: true,
“inputFields”: [
{
“typeDefinition”: {
“name”: “Phone_Number”,
“type”: “string”,
“fieldType”: “text”
},
“supportedValueTypes”: [
“STATIC_VALUE”
],
“isRequired”: true
},
{
“typeDefinition”: {
“name”: “country”,
“type”: “string”,
“fieldType”: “text”
},
“supportedValueTypes”: [
“STATIC_VALUE”
],
“isRequired”: false
},
{
“typeDefinition”: {
“name”: “propertyName”,
“type”: “object_coordinates”,
“fieldType”: “text”
},
“supportedValueTypes”: [
“OBJECT_PROPERTY”
],
“isRequired”: false
}
],
“outputFields”: [
{
“typeDefinition”: {
“name”: “quality”,
“type”: “string”,
“fieldType”: “text”
},
“supportedValueTypes”: [
“STATIC_VALUE”
]
},
{
“typeDefinition”: {
“name”: “message”,
“type”: “string”,
“fieldType”: “text”
},
“supportedValueTypes”: [
“STATIC_VALUE”
]
}
],
“labels”: {
“en”: {
“actionName”: “Check Phone Number”,
“inputFieldLabels”: {
“Phone_Number”: “Phone Number*”,
“country”: “Country (Optional)”,
“propertyName”: “Property to save the resuld (Optional)”
},
“outputFieldLabels”: {
“quality”: “Phone Number Quality”,
“message”: “Message”
}
}
},
“functions”: [
{
“functionType”: “PRE_ACTION_EXECUTION”,
“functionSource”: “exports.main = function(event, callback) { return callback(transformRequest(event)); }\nfunction transformRequest(request) { return { webhookUrl: ‘***’, body: JSON.stringify({phoneNumber:request.inputFields.Phone_Number, country:request.inputFields.country, propertyName:request.inputFields.propertyName, portalID:request.origin.portalId), contentType: ‘application/json’, accept: ‘application/json’, httpMethod: ‘POST’ }; }”
}
]
}
```