User Selected Form Data

I have a drop down that a user selects an order number from. I would like to use the selected item in another form. The first thing I’d like to do is assign the selected item to a variable and print it in the terminal. How do I do this?
For instance;

@login_required(login_url='/login')
def GroupOrders(request):
  submitted = False
  if request.method == "POST":
      form = GroupOrderNumberForm(request.POST)
      if form.is_valid():
        instance = form.save(commit=False)
        instance.user_name = request.user
        
        # How do you get the order number?
        orderNumber = GroupOrderNumberForm.order_NumberQuery(request.GET)
        print(orderNumber)
...

Are you talking about the case where the number is submitted in a form on one page, and then retrieved and displayed on another page?

If so, then you need to persist that data across views - you need to either store it in the database or in session (which is usually storing it in the database anyway).

You’ve created the form from the submitted data above →
form = GroupOrderNumberForm(request.POST)
It has also gone through the validation process →
form.is_valid()

Once the form has been cleaned, the submitted data is in the form.cleaned_data dict.

See the docs at The Forms API | Django documentation | Django and Form and field validation | Django documentation | Django