Setting a contact property with a value extracted from a code action.

Hello I need to save some data after to a contact property after getting checked through an API call.

 callback({
 botMessage: outputMessage
 responseExpected: false,
 customState: {
 hasValidCode: hasValidCode,
 customResponse: customResponse
 },
 outputFields: {
 //Output Variables to be called outside the code action using double curly braces (Example: {{codeExtracted}})
 codeExtracted: validCode
 }

 });

I was told that the outputFields in callback can be used in subsequent actions when referenced as {{codeExtracted}}, but this doesn’t work currently.

Currently I am trying to set this on the action right after the code snippet.

Should this be done using another method?

Hey @Igee ,

this looks like you’re using a custom coded workflow action from Operations Hub. In that case you have to define the possible output first under the code that needs to be executed, including its data type.

Next, you need to copy that output to your preferred property using the Edit Record action. First pick the property that needs to be copied to and then select Action Outputs and the output codeExtracted.

If you found this post helpful, consider helping others in the community to find answers faster by marking this as a solution. I’d really appreciate it.

Best,

Chriso

Can this be done in a chatflow custom code action as well?