Something’s acting up with data actions in Architect flows. I’m calling an endpoint to pull a user’s email address - just trying to pull a user’s email address - and the response isn’t parsing correctly. It’s returning a 200, but the variable I’m trying to set is always empty.
I think it’s something to do with the JSON structure changing, but I’m probably missing something basic. The documentation isn’t super clear on this - feels like it hasn’t been updated since the whole ‘wrapped’ response thing last year. Like that time the voice bot config broke.
Here’s the relevant bit from the data action config:
resource "genesyscloud_architect_flow" "example" {
name = "Data Action Test"
description = "Test flow for data action"
version = "1.0"
data_actions {
name = "Get User Email"
action_type = "http_request"
method = "GET"
url = "a request to retrieve the user's email address"
timeout_seconds = 10
parse_response_body = true
response_variable = "user_email"
headers {
"Authorization" = "Bearer ${data.genesyscloud_oauth_client.default.access_token}"
"Content-Type" = "application/json"
}
}
}
data "genesyscloud_user" "current_user" {
name = "" # or whatever user you're testing with
}
data "genesyscloud_oauth_client" "default" {
name = "your_oauth_client_name"
}
If it helps, we had a similar issue with the response variable not being populated - it was a case sensitivity issue with the variable name. The API returns the email in lowercase - so make sure the variable you’re assigning it to is also lowercase.
Side note - the documentation suggests the parse_response_body flag is crucial - it automatically tries to convert the JSON into usable variables. We’ve seen it fail occasionally with complex nested JSON - you might need to use a data action to transform the response if that happens. The error message isn’t very informative though - just “data action failed”.