I need help returning two values (tableName and query) to update client-state parameters UI Builder
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
I need to update two client-state parameters—tableName and query—when clicking on a data-visualization item in my UI Builder. I’m not sure how to correctly return and assign multiple values. I attempted some code, but it isn’t working. Can someone help me with the proper syntax?
/**
* @param {params} params
* @param {api} params.api
* @param {any} params.event
*/
function evaluateEvent({
api,
event
}) {
var query = event.payload.params.query;
var table = event.payload.params.table;
console.log("query " +query);
console.log("table " +table);
return {
updates: [
{ propName: "queryParam", value: query },
{ propName: "table", value: table }
]
};
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @Sathwik1 ,
I tried your problem in my PDI please check below screen shot and script
If you want to give dynamic props from script
please follow below syntax.
var query = 'active=true'
api.context.props.query(query);
You can also find this thing from official docs from ServiceNow
Let me know if you need more help!
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
