Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Default configuration isn't initially passed to the Python plugin

mkhtran
9 - Comet

There seems to be a bug(?) where the configuration object that the Python plugin receives is never set unless handleUpdateModel is called from the UI. This gives me the annoying issue where the default configuration set in the DesignerApi component never reaches the plugin until the user interacts with the UI.

 

const Tool: FunctionComponent = () => {
  return (
    <DesignerApi
      messages={{}}
      defaultConfig={{ Configuration: { foo: 'Hello, world!' } }}
    >
      <AyxAppWrapper>
        <App />
      </AyxAppWrapper>
    </DesignerApi>
  )
}
class MyPlugin(PluginV2):
    def __init__(self, provider: AMPProviderV2):
        self.name = "MyPlugin"
        self.provider = provider

        # This should be "Hello, world!" but the "foo" doesn't exist
        self.foo = self.provider.tool_config.get("foo") or ""

 

I'm currently getting around this by forcing an update when the UI loads.

 

const App: FunctionComponent = () => {
  const [model, handleUpdateModel] = useContext(UiSdkContext)
  useEffect(() => handleUpdateModel({ ...model }), [])

  return (
    /* ... */
  )
}

 

1 REPLY 1
alioubalde
5 - Atom

Hello,

 

Did you find any solutions ?

Labels
Top Solution Authors