Forum Stats

  • 3,728,431 Users
  • 2,245,616 Discussions
  • 7,853,524 Comments

Discussions

How to Pre-Seed Incident data for customer portal OPA?

User_B5W17
User_B5W17 Member Posts: 75 Red Ribbon

Hi,

I am wanting to load in data, for a particular incident related to a contact, on a front end interview. I can see the option in the mapping settings to seed in incident data at incident start. My question is how does it know which incident to seed in, how is this filtered? Can I select this via some sort of query, or filter method?

Thanks!

Tagged:
User_B5W17Aaron Houston - Houston Technologies LLC

Answers

  • Aaron Houston - Houston Technologies LLC
    Aaron Houston - Houston Technologies LLC Member Posts: 84 Red Ribbon
    edited November 2019

    Hey!

    Is your interview embedded in customer portal? If so, the traditional method, as per documentation, is to do this via URL parameters. Just like the 'a_id' url parameter is utilized to determine which OPA interview to load for which answer, the 'i_id' with the incident's id thereafter can be utilized to tell OPA which incident details to load from OSvC.

    For example, if you've modified the OPA widget to get the URL paramter 'i_id' and you feed that into the OPA PHP code where the 'i_id' is the initID, and you have some incident in OSvC, say 12345, then when you use the url https://<your-site>/app/answers/detail/a_id/<answer-id-associated-to-opa-interview>/i_id/12345/ OPA will then know you're attempting to load the interview for a_id, and the incident details for incident with ID = 12345.

    A snippet of this code initializing the i_id is as follows:

    to initialize the incident id url parameter:

    <?php

         $incidentID = \RightNow\Utils\Url::getParameter('i_id');

    ?>

    Now to use that url parameter in the call to OPA

    <?php

         if(getUrlParm('a_id') == <insert answer id created for OPA interview> {?>

              <rn:widget path="custom/opa/OPAWidget"

                      policy_model= "<insert your OPA model Name deployed to your hub>"

                      init_id=#rn:php:$incidentID#/>

    <?php } ?>

    Let me know if you have any additional questions.

    Regards,

    Aaron Houston

    User_B5W17
  • User_B5W17
    User_B5W17 Member Posts: 75 Red Ribbon
    edited November 2019

    Hi,

    many thanks for getting back to me Aaron. Yes the OPA interview is embedded in the customer portal utilizing the OPA widget.

    The specific scenario here is: A user logs an incident via OPA interview A. The user at a later date accesses OPA interview B (OPA Interview B should pre-seed the previously submitted data from OPA Interview A).

    I can see you mentioned the URL parameter, my question to this is how can I ensure that the correct incident ID is selected. Can this be passed as a dynamic value, ie via a query for the current contacts list of incidents with a specific product, and only select the latest ID to pass?

    Thanks

    Aaron Houston - Houston Technologies LLC
  • Aaron Houston - Houston Technologies LLC
    Aaron Houston - Houston Technologies LLC Member Posts: 84 Red Ribbon
    edited November 2019

    Hello,

    One easy way to do this is via a report that you can embed within CP. If you configure one column in the report to be a hyperlink that substitutes the incident ID into the URL, and embed this report in CP, they'll always be able to pre-seed the information as you expect.

    Another viable solution is to do the same thing via loading all incidents related to this contact into an OPA interview (C) which will handle the redirect to OPA interview B with the appropriate incident ID in the url.

    Regards,

    Aaron Houston

Sign In or Register to comment.