Getting Catalog Item answers from one item and posting them to another?

Maurice Murphy
Tera Guru

I'm getting an ask to try and create two catalog items which can essentially work in tandem to one another. The ask specifically is to create a catalog item that a user can submit (not something like an order guide or a record producer) in which a user can get a specific set of information.

This catalog item is intended to be very open ended with long branches of questions and answers to essentially walk a user through the entirety of a process in case they don't know anything about it from the start. The second catalog item should be used after a user has gone through the first.

The ask is this: To save a user from having to re-input information they may have put into the first catalog item, is there an easy way to pull in answers from one catalog item submission and put them into another before a user has even submitted the item?

I had thought to use Flow to get the variables from the other catalog form and just look up based on Requested For, but I realized that it wouldn't be possible until after the user submits the catalog item, which defeats the purpose. Any help is appreciated!

6 REPLIES 6

Hi,

You're welcome.

As mentioned, if you get stuck on a specific piece, let me know, and I'll be glad to assist. I wasn't saying that was your goal, I'm merely specifying my own goal in what I do on the forums. Personal to me.

Thanks!


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

Dan H
Tera Guru

Once the second catalog item is opened, you could have an onChange or onLoad client script that calls a script include.

Inside the script include, have a function that takes in the sys id of a User record. Run a GlideAjax query to check if there is a recent submission of the first catalog item from the passed in user.

If there's a match, loop through the first catalog item RITM and store all the field, value pairs into an object. Once the object is complete, set all of the values inside the object onto their respective fields in the new item.

You want a GlideAjax query because you are calling server side data from the client, this will provide better performance than GlideRecord in this case by utilising an asyncronous call to the database.