Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

UI Page Help !!

vidishaagarwal5
Tera Expert

How we can access parameter from UI action to Ui Page?

2 ACCEPTED SOLUTIONS

Ravi Gaurav
Giga Sage

Hi @vidishaagarwal5 

 

Example: pass parameter from UI action as shown below:

 

RaviGaurav_1-1760074867246.png

 

Method 1: Access parameter in html code.

We can attach value to html tag directly by using below syntax:
value="${sysparm_number}
Access parameter in UI Page HTML Code as shown below:

View solution in original post

Ravi Gaurav
Giga Sage

Hi @vidishaagarwal5 

There are another methods..

 

Method 2: Access parameter in UI Page client script.

Access parameter in UI Page Client Script Code as shown below:

RaviGaurav_2-1760075028178.png

Note: remember to always use variable name starting with sysparm_xxxxx

 

View solution in original post

6 REPLIES 6

Ravi Gaurav
Giga Sage

Hi @vidishaagarwal5 

 

Example: pass parameter from UI action as shown below:

 

RaviGaurav_1-1760074867246.png

 

Method 1: Access parameter in html code.

We can attach value to html tag directly by using below syntax:
value="${sysparm_number}
Access parameter in UI Page HTML Code as shown below:

miftikhar20
Kilo Patron

@vidishaagarwal5 ,

  // Get sys_id of the current record
    var sysId = current.getUniqueValue();
	var tableName = current.getTableName(); 

	// Get the current view name
    var viewName = action.getGlideURI().get("sysparm_view");
    if (!viewName) {
        viewName = "default"; // fallback if no view specified
    }

    // Build Service Portal URL (use your page ID: test)
    var portalPage = gs.getProperty('glide.servlet.uri') + 'sp?id=test&table=' + tableName + '&sys_id=' + sysId + '&view=' + viewName;

    // Redirect user to Service Portal page
    action.setRedirectURL(portalPage);

 

Above UI action script redirects with sys_id, table, view of record - update it for your use case, place this code under script section of your UI action.

@miftikhar20 it didn't work for me

Yes, it won't. This script works when you want to send data from a record via UI action to the portal page, not the system UI pages.

Anyways, glad you got the required solution.