Is there a way to pull variables from a previously submitted RITM

CatchTheFletch
Tera Contributor

I have a cat item that is basically update information from a previous cat item submission. Users will submit the first one and on that first form there is a date option they can select. This date can change so what I would like to do, if possible, is have the user submit a new form that references the old RITM (which I do through a reference variable), but I would like the new form to pull the variables from the old RITM. I can make the same variables and hide them from the form, but I'm not sure how to get the variables to populate with the old information. I'm assuming I can script it but a little lost in how to go about it.

5 REPLIES 5

Allen Andreas
Administrator
Administrator

Hi,

Just to ensure I'm on the same page, basically, the goal here is to support users being able to update information on a previously submitted request, correct?

 

Is there a particular reason why the user can't access the old request and then simply leave a comment to change 'x' field to 'y' value?

We don't have the context of the scenario, fully, but having users use another form to update a separate request may complicate things a bit more. If you still wish to proceed, to accomplish what you're trying to do, you'd want the user to select a prior request from a filter reference field pointing to requests (request items) and then upon selection, the fields show up and then you use GlideAjax in an onChange client script to communicate with the server to get the request details and then bring that back and then set the values for those fields as appropriate. Ideally, you'd name the fields the same to make it easier to map the values.

 

Here's a GlideAjax cheat sheet to help: https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet/ta-p/2312430 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Not exactly. They aren't updating information on the old RITM itself. They are using a different form to submit a date change for the old RITM. It will go through a different flow, but what is important is it pulls the values from the old RITM's variables and sets the new form (with the same named variables) to the old values except for the date which the user sets in the new form. Does that help make more sense? The old RITM could be closed and done but the new RITM will update the appropriate teams of the date change.

Hi,

Thanks. Yeah, most of what I said above still applies, so please read over that as it will help guide you.

My beginning of my reply was more so questioning what the end-goal was and it still sounds like it to a degree, but anyways, it doesn't matter as I've already covered how to do what you wanted, above 🙂

 

Applies above in my reply where I say: "If you still wish to proceed..."


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Well thank you. I am looking into it and appreciate the response!