record producer - showing previously saved data on the form

Alka Sharma
Tera Contributor

Hi All, I need to understand few things within record producer. Could someone please guide?

1) A user has certain accesses of some applications, now user opens a record producer and is requesting a new access for another application via this form. Is it possible to show/display this user on the the same form, all the applications of which this user already has access to, so that another access is selected by this user.

 

Above scenario for the case when i) these accesses details are saved in ServiceNow and ii) When these details are saved in another system which is integrated with ServiceNow.

 

2) Bulk approval possible via record producer?

1 ACCEPTED SOLUTION

Amit Gujarathi
Giga Sage
Giga Sage

HI @Alka Sharma ,
I trust you are doing great.
Here's a simplified example of how you might implement this in the client script of the record producer form:

// Client Script for the Record Producer Form
function onLoad() {
    // Query user's existing accesses
    var user = gs.getUser(); // Assuming you're on the server side
    var existingAccesses = new GlideRecord('existing_access_table');
    existingAccesses.addQuery('user', user.getID()); // Assuming there's a field 'user' to store the user ID
    existingAccesses.query();

    // Display existing accesses on the form
    while (existingAccesses.next()) {
        // Populate existing accesses on the form (e.g., in a related list or reference field)
    }
}

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



View solution in original post

3 REPLIES 3

AshishKM
Kilo Patron
Kilo Patron

Hi @Alka Sharma , 

You can exclude those application which are already assigned to that user, if ServiceNow has record of application and user mapping. Apply filter and exclude. Which table you are referring here for application.

 

If some other application is storing the user's access details then, need some integration in place to get the list of application for exclusion  on record producer form at run time. 

 

2) Bulk approval possible via record producer? >> Not much clear the requirement. 

 

-Thanks,

AshishKM

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Amit Gujarathi
Giga Sage
Giga Sage

HI @Alka Sharma ,
I trust you are doing great.
Here's a simplified example of how you might implement this in the client script of the record producer form:

// Client Script for the Record Producer Form
function onLoad() {
    // Query user's existing accesses
    var user = gs.getUser(); // Assuming you're on the server side
    var existingAccesses = new GlideRecord('existing_access_table');
    existingAccesses.addQuery('user', user.getID()); // Assuming there's a field 'user' to store the user ID
    existingAccesses.query();

    // Display existing accesses on the form
    while (existingAccesses.next()) {
        // Populate existing accesses on the form (e.g., in a related list or reference field)
    }
}

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



@Amit Gujarathi Thanks