Getting Catalog Item answers from one item and posting them to another?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2022 03:01 PM
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!
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2022 06:09 PM
Hello,
You could attempt to build this with just one catalog item and ask them an initial question like:
Need guided assistance? If they select yes, then do the walk through, etc.
If they select no, then you could ask a second question about importing last submitted catalog item answers.
Based on this, which would trigger an onChange Client Script, you could pass the user to a script include via GlideAjax and then query the most recent submitted catalog item of the same and then pass back to your Client Script an object with all the fields and their values, which you'd then parse and set the values of.
Rough idea, but that's where you could at least keep everything in one catalog item.
If you still want two, then essentially the same overall concept applies.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2022 08:40 AM
This is helpful, thank you! I would like to keep things in one catalog item if possible just to keep things clean, so I think I'll take this approach. I'm not sure I quite understand what you mean, however, by "pass the user to a script include via GlideAjax".
If I'm understanding correctly, are you saying that:
- Start by asking the user a question about guided setup which then takes them down a set of questions walking them through the process.
- Once the user submits the guided setup, provide them answers based on their responses (Process to take, documents needed, time to complete, etc.)
- Then, if they go through the same catalog item again, create some kind of GlideAjax query to pull in and set variables from their previous submission by looking up based off of item name and requested by.
Let me know if that sounds right, I'm really curious to know how this works. Not very familiar with Glide and script includes (we generally try to avoid them in my office) so if this is the only route to take it'll be an interesting discussion!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2022 09:48 AM
Hi,
I recommend maybe re-reading my post above just to sort of think it through a bit more and bounce what you've asked me, off of what I've said to double-check that I didn't already answer that.
As far as Script Includes (via GlideAjax) and GlideRecord, please refer to the two links I posted. One is a cheat sheet for GlideAjax and how to use it, the other is the official documentation for GlideRecord and again...how to use it.
You didn't give all the details like you're mentioning in your reply, so I'm unsure how to answer that because you know what you're talking about...we don't.
All we got from you initially is that person A would submit a catalog item. If person A needs to use it again...help fill in the values for them from their previous request. I don't think much else was said there (I may have missed it and if so, my apologies).
So with that basic thought, I gave my reply and further suggested to try and keep it all within the same catalog item.
- person A goes to use catalog item and is asked if they wanted guided setup or not, if not, then query for past use (pass the user information in an onChange client script for that field when they chose no for guided setup, via GlideAjax, to your script include, to query the catalog item of the same for the same user and get the variable values from that occurrence and bring it back to the client) and fill in fields
- person A goes to use catalog item and is asked if they wanted guided setup or not, if so, then walk them through it (however that means to you)
Feel free to attempt yourself, if you get stuck, let me know specifically where. My goal is to help you learn and I feel I've given a good amount of information, documentation/links, reiterated a few things, etc. Please try.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2022 09:54 AM
Probably miscommunication on my part. I was just confirming what you were suggesting before digging in the wrong direction! Seems like I had a solid understanding of your suggestion so I'll make an attempt at it. Obviously the goal isn't to get the community to do my job for me.
Thanks for your response!