Sep 29, 202110:49 AM - edited Sep 29, 202111:23 AM
Contributor | Elite Partner
Need assistance with correct Hubl code
SOLVE
I need some assistance in determining the correct Hubl code for my scenario below. I am trying to grab part of a request query to use as the customer id in order to pull data from a HubDB table. The code was working correctly but I believe I broke it when adding an additonal parameter (assigned_dealer_v2=) to the requst query to be used in a hidden form field.
Update - I have still not been able to get it to work correctly. I am sure it's going to be something simple. I changed up the code a bit to make it easier to see what value is being rendered if I output it to the page.
New Code-
{% set dealer = '{{ request.query|split("=")|last|trim }}' %}
{% set dealerval = 'customerid='~dealer|render %}
{% for row in hubdb_table_rows(5241455, dealerval) %}
If I output {{ dealerval }} on the page, it shows a value of 'customerid=00010928-tx' which is correct and should filter the table to those rows that match.
If I manually input the info for dealerval as such:
{% set dealerval ='customerid=00010928-tx' %}
Everything works correctly and it pulls the appropriate info from the row and displays it on the page.
Any additional thoughts or suggestions would be greatly appreciated.
Hello @tmcmillan99 , can you output the dealer id with a {{dealerval}} so that we can see that the correct value is pulled off the request query? I used your exact code and it does indeed pull the "00010928-tx" value. Maybe the issue is with the hubdb.
@miljkovicmisa Thanks for the reply back and confirmation that the code is working as it should. I have not looked at the HubDB table yet. It was recently updated by the client so that will definitely be my next step.