# Call Templates - Using call parameters in a call template export

**URL:** <https://community.novulo.com/t/call-templates-using-call-parameters-in-a-call-template-export/165>\
**Category:** \[Q&A\] Using the Platform\
**Created:** [May 13, 2024, 10:45am UTC](https://community.novulo.com/t/call-templates-using-call-parameters-in-a-call-template-export/165 "2024-05-13T10:45:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![j.batzke](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.novulo.com/j.batzke/32/9_2.png) [@j.batzke](https://community.novulo.com/u/j.batzke)\
**Post date:** [May 13, 2024, 1:30pm UTC](https://community.novulo.com/t/call-templates-using-call-parameters-in-a-call-template-export/165/2 "2024-05-13T13:30:29Z")

</div>

Hey Geert Jan!

I understand the problem that with every call, you want to send data based on a different context. There are several solutions to this problem. The one below is the most straightforward:

# Using the ‘parameters’ parameter

The process ‘N\_Call Template Build, Execute, Process’ has a parameter called ‘parameters’ of type ‘List\<Tuple\<String,Mixed\>\>’.  
You can pass as many context records/data as you want. When the process reaches the default building step, then those parameters will be passed down to the process that uses the export definition/data definition to build the XML/JSON body of the call.  
This happens by default if you set an export definition (or a data definition) at the call template:

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/1X/8f7749b635106122d0e7077ea2d93d6daab97c83.png)

Make sure that the linked export definition uses parameters (1) and that you defined some parameters. In my case, I set a parameter ‘prompt’ of type ‘string’. But you can really use any kind of parameter.

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/1X/a250d8fddfc9b9236c7d524609e5c898516d8700.png)

After adding a parameter, make sure that it is also used as a placeholder within the export definition. In my case, I put ‘%prompt’ in a field. Then i used an XSLT to get the following body: {“model”: “gpt-3.5-turbo”, “messages”: [{“role”: “user”, “content”: “ **%prompt** ”}]}.

To try out if everything works, you can use the test panel on the call collection page. Tuple lists have the following format " [\<“key1”,“value1”\>,\<“key2”,“value2”\>]"

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/1X/d4f97862cff010265d6bb4eae9bf8abc934ee18d.png)

In my case, I got this beautiful response:

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/1X/49cfa3d0eda7247288a5bc8a2901c6541d7ad1f0.png)

# Linking context records to a call

As an addition it is also possible to link the call record to a Novulo record and then only pass the current N\_Call record to the export definition. For example, before building a call, you can set a field at the call and link it to an N\_Purchase record with a process that you build. So, for example, call with ID 1 would be linked to purchase with ID 123. See M10069 ‘N\_Call - Ensure purchase at call’ for example.

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/1X/2f609ff06e4c13674e676aab5f4b90dc56d125be.png)

Then, only the parameter “call” can be passed to the export definition. Within the export definition, you can then access the purchase record via “%call.purchase”.  
The advantage of this approach is that you can add the purchase field as a column in grids and that you can use it for filtering. If for example you executed multiple calls for purchase 123 you can add a list of all calls for a specific purchase to the purchase page.

Furthermore, when the process ‘N\_Response - Process’ is executed, the purchase record can be accessed as well via ‘trigger.response.call.purchase’ to make changes to it. For example, one could update a status to ‘has been sent successfully’ or to ‘retry sending’ depending on the response.  
If you want to process your received data similarly, let me know! In this case, I would like you to use **‘M10388 - Novulo Call template processes’** so that you can execute custom processes before/after building/processing calls.

---

_[View the full topic](https://community.novulo.com/t/call-templates-using-call-parameters-in-a-call-template-export/165)._
