APIs & Integrations

Igee
Participant

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

SOLVE

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?

 

1 Accepted solution
ChrisoKlepke
Solution
Key Advisor | Elite Partner
Key Advisor | Elite Partner

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

SOLVE

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. 

 

Screenshot 2025-06-18 at 13.32.41.png

 

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.

 

 

Screenshot 2025-06-18 at 13.33.14.png

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

View solution in original post

2 Replies 2
ChrisoKlepke
Solution
Key Advisor | Elite Partner
Key Advisor | Elite Partner

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

SOLVE

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. 

 

Screenshot 2025-06-18 at 13.32.41.png

 

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.

 

 

Screenshot 2025-06-18 at 13.33.14.png

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

Igee
Participant

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

SOLVE

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

0 Upvotes