Question

Scoped user attributes do not resolve to a value

  • 12 January 2022
  • 0 replies
  • 6 views

I followed this document on how to create scoped user attributes: https://github.com/LukaFontanilla/luka_extension_framework_documents/blob/main/Third%20Party%20API%20Calls%20Extension%20Framework.pdf

However, my Scoped user attributes do not resolve to a value within my code.

import { ExtensionContext } from '@looker/extension-sdk-react'

const context = useContext(ExtensionContext)
const { extensionSDK } = context

const client_id = extensionSDK.createSecretKeyTag('mailbroker_client_id');
const client_secret = extensionSDK.createSecretKeyTag('mailbroker_client_secret');

//const client_id = 'hardcodingClientIdWorks';
//const client_secret = 'hardcodingClientSecretWorks';

const response = await extensionSDK.serverProxy(...)

const {access_token} = response.body

const resendEmail = await extensionSDK.fetchProxy(...)

If I print them to console, I can clearly see that it prints correct key name:

client_id {{transactional_messaging_system_email_logs_mailbroker_client_id}}
client_secret {{transactional_messaging_system_email_logs_mailbroker_client_secret}}

I can also see them under User attributes:

{
"id": 17,
"name": "transactional_messaging_system_email_logs_mailbroker_client_id",
"label": "Transactional Messaging System Email Logs Mailbroker Client Id",
"type": "string",
"default_value": "DEFAULT_IS_SET",
"is_system": false,
"is_permanent": false,
"value_is_hidden": true,
"user_can_view": true,
"user_can_edit": false,
"hidden_value_domain_whitelist": "https://enterprise-api-stg.autodesk.com/v2/oauth/generateaccesstoken",
"can": {
"show_value": true,
"show": true,
"index": true,
"set_value": false
}
},
{
"id": 18,
"name": "transactional_messaging_system_email_logs_mailbroker_client_secret",
"label": "Transactional Messaging System Email Logs Mailbroker Client Secret",
"type": "string",
"default_value": "DEFAULT_IS_SET",
"is_system": false,
"is_permanent": false,
"value_is_hidden": true,
"user_can_view": true,
"user_can_edit": false,
"hidden_value_domain_whitelist": "https://enterprise-api-stg.autodesk.com/v2/oauth/generateaccesstoken",
"can": {
"show_value": true,
"show": true,
"index": true,
"set_value": false
}
}

manifest.lkml

application: email_logs {
label: "Email Logs"
file: "bundle.js"
entitlements: {
use_embeds: yes
use_form_submit: yes
core_api_methods: [
"all_groups",
"all_user_attributes",
"all_scheduled_plans",
"me",
"run_query",
"run_inline_query",
"update_scheduled_plan",
"user_attribute_user_values"
]
external_api_urls: [
"https://4j5db26ox1.execute-api.us-west-2.amazonaws.com/Prod/resend",
"https://enterprise-api-stg.autodesk.com/v2/oauth/generateaccesstoken"
]
scoped_user_attributes: ["mailbroker_client_id", "mailbroker_client_secret"]
}
}

Does anyone see what I am doing wrong in my code?


0 replies

Be the first to reply!

Reply