now I have an application integration that consists of 3 main components
1) API Trigger
2) Cloud function
3)Data mapper task
the integration takes a json object as an input and should call the cloud function for some simple property extraction in node.js and should also return a json object as an output of integration
the problem is I can not receive the output of the cloud function step in my data mapper step
the cloud function executes successfully according to the logs and returns in error info { âmessageâ: ââ, âcodeâ: 0.0 }
am sure that the cloud function itself runs and returns the expected output because I tried this from another application integration that calls the cloud function but using REST callout instead of Cloud function task
I just can not get it done using the cloud function task , can not receive the output object though the integration executes successfully with no errors
Use javascript but with correct output format. The format should be like
let response = {âeventParametersâ:{âparametersâ:[{âkeyâ:âinputâ,âvalueâ:{âstringValueâ:â2â}}]}}; res.send(JSON.stringify(response));
Note:Cloud Function task in Application Integration only supports Python language runtime. Contact technical support for information on using other runtime languages.
It would indicate your Cloud function has to be in Python?
You can use âLink existing functionâ on the cloud function task config panel. Application Integration will parse the response and set the variable accordingly.
I already did that and linked it to the existing cloud function,
so just to make sure I get this straight
if I need to return this object { âfullnameâ: âJohn Doeâ, âtitleâ: âSoftware Engineerâ, âworkingPeriodâ: 9 }
it needs to be in this format ??
// Prepare the response in the required format
const response = {
eventParameters: {
parameters: [
{
key: âfullnameâ,
value: { stringValue: fullname }
},
{
key: âtitleâ,
value: { stringValue: title }
},
{
key: âworkingPeriodâ,
value: { stringValue: workingPeriod.toString() } // Convert to string if needed
}
]
}
};
// Send the formatted response as JSON
res.send(JSON.stringify(response));
Since you donât need to read those param inside the cloud function, you donât have to add them in the task param. And based on your need, you can define them as output or local variables.