UI Builder - Create an event link

SnowDevOps
Giga Guru

Hello 

I have created  table list and when the user click on the table, it links to the list of incident. However, it's not working when i tried to click. 

SnowDevOps_0-1738698388655.png

I have 2 parameters (tableName, queryFilter). I'm not sure what's wrong with the script. It seems fine to me. 
Thanks. 

/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
*/
function evaluateEvent({api, event}) {
    return {
        route: "list-item",
        fields: {
            tableName: event.payload.params.table,
            fields: {"tableName":event.payload.params.table},
            params: {"tableName":event.payload.params.table,"queryFilter":event.payload.params.table},
            redirect: null,
            passiveNavigation: null,
            title: null,
            multiInstField: null,
            targetRoute: null,
            external: null,
            navigationOptions: null
        }
    };
}

 

1 REPLY 1

Diogo Ramos
Giga Sage

Hello, you seem to have a problem on your queryFilter parameter, you did a copy paste from the table parameter:

 params: {"tableName":event.payload.params.table,"queryFilter":event.payload.params.table}


I tried just creating a new dashboard in the csm workspace, and adding 1 visualization widget, and using the simplelist page that is available in the workspace it works fine:

 

/**
 * @Param {params} params
 * @Param {api} params.api
 * @Param {any} params.event
 */
function evaluateEvent({
    api,
    event
}) {
    return {
        route: 'simplelist',
        fields: {
            table: event.payload.params.table,
        },
        params: {
            query: event.payload.params.query,
            listTitle: event.payload.params.listTitle
        },
        redirect: null,
        passiveNavigation: null,
        title: null,
        multiInstField: null,
        targetRoute: null,
        external: null
    };
}

 

But again, my solution is based on the simplelist page on the default workspace, you would have to confirm that your list page after fixing the issue mentioned above is indeed expecting the params names you are passing to it. 

You also don't need a script, you can just use the low code approach by clicking select destination and selecting the right page, then just configure it as follows:

DiogoRamos_1-1739831117979.png

 

DiogoRamos_0-1739831094822.png

It will result in the same behaviour. 

I hope it helps
Diogo