Custom workflow for property

I am trying to write a workflow with custom code but cannot seem to get it to work using the format data action.

I want to take the text in an existing contact property and in a separate contact property, combine it with and after a line of text.

I tried doing a concat function and it didn’t work. I don’t understand how I am supposed to implement where this formatting is happening.

Any ideas?

Hi @mjuozokas,

Can you please share the code the what exactly you’re trying to concatenate?

You might not even need custom code, by the way.

Let’s assume your existing contact property is the record ID and you want to prepend the line of text “ID-”, so that a result would look like this: ID-132435

If so, you could simply use the “Set property value” action in your workflow. It accepts personalization tokens and text.

Hope this helps!

I have a question quite similar this topic:

I’m trying to create custom workflow action. I need to send internal_name 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. It send the value but i need the internal name or the property name.
Thanks in advance.

{
 "actionUrl": "******",
 "objectTypes": [
 "CONTACT"
 ],
 "published": true,
 "inputFields": [
 {
 "typeDefinition": {
 "name": "propertyName",
 "type": "object_coordinates",
 "fieldType": "text"
 },
 "supportedValueTypes": [
 "OBJECT_PROPERTY"
 ],
 "isRequired": true
 }
 ],
 "outputFields": [
 {
 "typeDefinition": {
 "name": "message",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": [
 "STATIC_VALUE"
 ]
 }
 ],
 "labels": {
 "en": {
 "actionName": "test",
 "inputFieldLabels": {
 "propertyName": "Property to save the result (Optional)"
 },
 "outputFieldLabels": {
 "message": "Message"
 }
 }
 },
 "functions": [
 {
 "functionType": "PRE_FETCH_OPTIONS",
 "functionSource": "exports.main = (event, callback) => {\n callback(transformRequest(event));\n}\n\nfunction transformRequest(request) {\n return {\n webhookUrl: '******',\n body:{\n Property_name: request.inputField.propertyName },\n contentType: 'application/json',\n accept: 'application/json',\n httpMethod: 'POST'\n };\n}"

 }
 ]
}