CA Service Management

  • 1.  Retrieving info from past form submissions

    Posted Jun 29, 2017 12:52 PM

    I have several forms that each contain like fields in them, and it would be nice to be able to populate these fields based on a previous form submission.

    For example: A user fills out a form about a new hire. A month later, that user needs to update some information on that new person. So they pull up the Modify Person form. Whether than having to input all of the info over again, while making some changes, it'd be great if they could enter a name or past ID number and have the info populate.

    I've looked into the usm_request_item_form table and found what I need, but it is stored in a format that I can't access.

    I've also been reading about ca_reportQuery which seems like this is doing what I want to do, but I don't really understand it.

    Am I looking in the right place? Am I even on the right track?



  • 2.  Re: Retrieving info from past form submissions

    Posted Jun 29, 2017 03:16 PM

    Hi Stephen,

     

    It is possible to query form data in previous requests in usm_request_item_form.  However, I'm wondering what data you are exposing to the user to modify?  If the updates are reflected in the ca_contact table it would be easier/better to query that table.



  • 3.  Re: Retrieving info from past form submissions

    Posted Jun 29, 2017 03:33 PM

    Yeah, it'd be great if I could use ca_contact, but it's much more info than just names and email that I need. It's all new data. The problem with usm_request_item_table is that all the info is in one single table instead of individual tables. 



  • 4.  Re: Retrieving info from past form submissions

    Posted Jun 29, 2017 04:42 PM

    What I've done in the past is provide a lookup for past Request IDs on a form and when selected it fires off functions to populate fields on the form with data from the past request.  You could do the same here.. The Request ID is the foreign key for the usm_request_item_form table so that needs to be returned and passed into the javascript functions for updating other fields on the form. You could also concatenate several columns together and display that as the label for the lookup.



  • 5.  Re: Retrieving info from past form submissions

    Posted Jul 10, 2017 11:06 AM

    I think I need to use the ca_fdInvokePlugin method to query the database based on the input from a select field, but I don't fully understand how the method works.

    My thought is...

    User selects Catalog ID number from a previous job. I have created a query using the usm_request_item_form that pulls up Catalog IDs.

    The act of doing that would then activate a function that would query a new lookup on the database and fill in a field based off the Catalog ID previously selected. That's where ca_fdInvokePlugin would come into play, correct?

    My problem is that I need a "real world example" of how it works - ie: the CA docs are a bit vague for me to understand. I don't know which variable gets filled in to which parameter.



  • 6.  Re: Retrieving info from past form submissions

    Posted Jul 10, 2017 12:02 PM

    Hi Stephen,

     

    Your'e on the right path.  Here's a high level description of how we accomplish this.

     

    1. User selects a past Request from a Request ID lookup on the form, which saves the Request ID to a hidden field

    2. An on change event is fired when a Request ID is selected which will invoke ca_reportQuery passing the Request ID as the variable to the reportQuery.

    3. The returned data is then parsed and loaded into the form.  

     

    I've linked an example offering which has this functionality built into it (couldn't figure out how to attach).  Open the xml files up in a text editor and replace the text "replace_with_bu" with your root business unit.  This example shows how to pull Text field and Select fields from past requests.  Dual lists and select fields with multi select area also possible but have more complicated JS, let me know if you want examples of that..  Import both the Service Offering and Report Data once the replace_with_bu text has been updated.

     

    OneDrive Link