Reading config parameters from Angular web portal

Hello group,

We have created a new tile in the Web Portal home page, and among other things we want to add a link inside this new tile with a specific URL.

The thing is that this URL could change in the future and to avoid a new build and transport to the different environments, we would like to add a config param in the designer that stores the url.

Now, How can be a config param be read from the angular Web Portal?

Any code snipped, showing how to do it would be much appreciated. ;)

Thanks in advance.

David 

Parents
  • Hi, David,

    There are several ways to achieve this. You can create a custom api endpoint to run a script or a stored sql sentence that returns your config param. 

    Also, I dont know if there's a specific api endpoint for config params, but in v93 where I've tried, you can read dbobjects with their uid , given that you have read permissions on them.

    So:

    1. Create your config param in Designer.
    2. Right click on it and find its UID
    3. Give read permissions to your portal users on the DialogConfigParm table and the UID_ConfigParm and Value columns
    4. After that you can issue a get <Apiserver>/portal/dbobject/DialogConfigParm/<uid of the param> and you'll get the Value.

    HtH!

  • HI all, I also wanting to get the value of a configuration parameter (Designer), can you share example code for a component? Is it using the qerApiClient? I managed to query the person membership to an application role, probably something similar using portal_dbobject_get()?

    const filterparm: CollectionLoadParameters = { filter: [] };
    filterparm.filter.push({
    ColumnName: 'UID_AERole',
    Type: FilterType.Compare,
    CompareOp: CompareOperator.Equal,
    Value1: "5d4fb783-7032-4db2-9ffe-595547c9af76",
    });
    let userId = (await this.session.getSessionState()).UserUid;
    var roles = await this.qerApiClient.client.portal_person_rolememberships_AERole_get(userId, filterparm);
    roles.Entities.forEach(role => {
    if (role.Display === "RoleName") {
    this.showUpdateButton = true;
    } else {
    this.showUpdateButton = false;
    }
    });
  • Yes, just the same. It is in the qerAPIClient : 

    this.qerApiClient.client.portal_dbobject_get(<TableName>,<UID>)

Reply Children
No Data