# User Input - is there a variable to use within the Query

**URL:** <https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503>\
**Category:** General\
**Created:** [July 16, 2024, 4:36pm UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503 "2024-07-16T16:36:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrPCMan](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@MrPCMan](https://community.pickaxe.co/u/MrPCMan)\
**Post date:** [July 16, 2024, 4:36pm UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503/1 "2024-07-16T16:36:19Z")

</div>

so, i have a pretty large query, i want to have two User Inputs [Location:] and [Current Date:] and those inputs are vital to the query and the use of them are show multiple times within the query. In the very beginning of the query, middle and end. How do i pass those values throughout the query and have the LLM understand that it’s working the way it should? I am working on screenshare and will get that to you later today. Hopefully, i have explain enough.

---

<div class="post-metadata">

**Author:** ![admin\_mike](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.pickaxe.co/admin_mike/32/283_2.png) [@admin\_mike](https://community.pickaxe.co/u/admin_mike)\
**Post date:** [July 16, 2024, 10:15pm UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503/2 "2024-07-16T22:15:27Z")

</div>

This is a great question. I’m assuming you are building a smart-form, but similar logic applies to chatbots.

So let’s say in the beginning of the prompt you have something like:

> You will help the user build a travel plan using the following details.  
> CURRENT LOCATION: (user input)  
> CURRENT DATE: (user input)

Then, later in the prompt you can continue to refer the variables.

> Come up with a travel plan that starts in their CURRENT LOCATION and ends in Baltimore. etc. etc.

The key thing to remember is that our system will gather their user inputs, then assemble the full request (with user input blanks replaced with the actual values inputted by the user) and then will send it off to the underlying LLM like GPT-4. So as long as you label the the areas with the user inputs in the prompt, you can refer to them elsewhere without trouble.

---

<div class="post-metadata">

**Author:** ![gtrusler](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.pickaxe.co/gtrusler/32/187_2.png) [@gtrusler](https://community.pickaxe.co/u/gtrusler)\
**Post date:** [August 12, 2024, 8:58pm UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503/3 "2024-08-12T20:58:32Z")

</div>

I thought I posted a similar question, but I can’t find it. I like this, but I’d like to be able to hard code it in the system prompt - especially the date and time. I use a different platform that allows me to use something like this in the system prompt:

Today is {local\_date}, local time is {local\_time}.

That way the LLM always knows the date and time without requiring any input from the user.

---

<div class="post-metadata">

**Author:** ![admin\_mike](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.pickaxe.co/admin_mike/32/283_2.png) [@admin\_mike](https://community.pickaxe.co/u/admin_mike)\
**Post date:** [August 13, 2024, 4:49pm UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503/4 "2024-08-13T16:49:55Z")

</div>

We don’t have a system that pulls the real date and time, but you could ask the user to provide those values and then you’d re-use them.

---

<div class="post-metadata">

**Author:** ![landed](https://avatars.discourse-cdn.com/v4/letter/l/a88e57/32.png) [@landed](https://community.pickaxe.co/u/landed)\
**Post date:** [October 16, 2024, 5:28pm UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503/5 "2024-10-16T17:28:00Z")

</div>

This should be quite trivial for the dev team so hopefully a few of us vote for this.

---

<div class="post-metadata">

**Author:** ![ab2308](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.pickaxe.co/ab2308/32/1542_2.png) [@ab2308](https://community.pickaxe.co/u/ab2308)\
**Post date:** [October 16, 2024, 10:57pm UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503/6 "2024-10-16T22:57:02Z")

</div>

Hi @landed

You can use a custom action and add a library for the date and time?

Something like

```auto
import os
import datetime
import pytz

def current_time_and_date(: str):
    """
    Return the current time and date

    Args:
         (string): 
    Envs:
         (string): 
    """

    # Insert your PYTHON code below. You can access environment variables using os.environ[].
    # Currently, only the requests library is supported, but more libraries will be available soon.
    # Use print statements or return values to display results to the user.
    # If you save a png, pdf, csv, jpg, webp, gif, or html file in the root directory, it will be automatically displayed to the user.
    # You do not have to call this function as the bot will automatically call and fill in the parameters.

    # Get current time in UTC
    utc_time = datetime.datetime.now(pytz.utc)
    print(utc_time)

    # Convert to a specific timezone (e.g., Australia/Melbourne)
    melbourne_time = utc_time.astimezone(pytz.timezone('Australia/Melbourne'))
    print(melbourne_time)

```

---

<div class="post-metadata">

**Author:** ![landed](https://avatars.discourse-cdn.com/v4/letter/l/a88e57/32.png) [@landed](https://community.pickaxe.co/u/landed)\
**Post date:** [October 17, 2024, 8:41am UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503/7 "2024-10-17T08:41:42Z")

</div>

Thank you to alerting me to use code myself in pickaxes. I will see if I can work that bit out now.

```auto
from datetime import date

current_date = date.today()
print(current_date)

```

---

<div class="post-metadata">

**Author:** ![landed](https://avatars.discourse-cdn.com/v4/letter/l/a88e57/32.png) [@landed](https://community.pickaxe.co/u/landed)\
**Post date:** [October 17, 2024, 9:02am UTC](https://community.pickaxe.co/t/user-input-is-there-a-variable-to-use-within-the-query/503/8 "2024-10-17T09:02:29Z")

</div>

Looks like I would need to upgrade my membership as I only get 1 slot for emailing the summary action.  
Also upgrading only then gives you 2 actions so that is not worth it for me. I would need 4 actions to make a useful application.  
That’s a shame. Perhaps this limit could be lifted a little.
