Data binding not working after initial app installation

Hi Team,

I have a case where I’ll be pre-populating an input field in the iparams.html page with the API key (using data binding).
However, the input field only gets pre-populated during the very first installation but after that, it does not get pre-populated as required.

Does data binding only work during the first installation? Please let me know.

Regards,
Clement

When you refer to after installation, is it when the admin opens up the app settings page to change any of the installation parameters?

Yeah, Saif. We have an input field for getting the logged-in user’s API key using data binding. This field is not pre-populated when the admin opens the settings page to change the parameters.

There’s one way maybe you can solve this.

Since this information is already stored as installation parameters in the app, we can retrieve them and at runtime by making the installation page dynamic.

iparams.json

"api_key": {
    "display_name": "Freshdesk apikey",
    "description": "freshdesk API requires app calls to include API keys in all of their requests",
    "secure": true,
    "type": "text",
    "data-bind": "product.api_key", // Using data-bind
    "required": true
  },
"creatorDomain": {
    "display_name": "Who is creator of Ben 10 cartoon series",
    "type": "domain",
    "description": "devrel",
    "data-bind": "product.domain", // Using data-bind
    "type_attributes": {
      "product": "freshdesk"
    }

iparams.js

async function onFormLoad(){
  let client = await app.initialized();
  let installedDomain = await client.iparams.get("domain"); // domain is installation parameter in iparams.json
  utils.set("domain", {value: installedDomain };
}

How about trying this?

Thanks for the response, Saif.

But in our case we want this input field in the iparams.html page to always get the logged-in user’s API key.
Is there a way we can achieve this?

The API Key is supposed to be a secure installation parameter, so I guess the payload might not return us the API Key to be auto populated.

@App-Platform-Squad

We have two questions:

  1. Does the data-bind feature only works once during the installation by design? Or is it a bug?
  2. If @Clement_Franklin wants to autopopulate a secure installation parameter whenever user opens up app installation page consequent times post installation, how can one do it?

Looping @alagu.chandran

@Clement_Franklin,

yes, when the user comes first, during installation, it will prepopulate using data-bind, and after installation, this won’t replace the saved value.

Hope it helps :slight_smile:

Thanks

@Clement_Franklin

Do you mind letting us know what is helpful to the user when API key is prepopulated during configuring the app? Do you see the user wanting to change the API key often?

@Saif
We want to be able to always display the API key of the logged-in user on the iparams page of the app. Is this possible?

That is not likely possible today, @Clement_Franklin

But do you mind elaborating on why a user might want to see API Key displayed every time they open the app’s installation page?

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.