Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9172171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:16:57+00:00 2026-06-17T16:16:57+00:00

Not sure if this is possible or not. What I am trying to do

  • 0

Not sure if this is possible or not. What I am trying to do is build an output string via queries. I am concatenating the output “name” and appending the “value” to the end. Then outputting the string. I don’t think this is possible. But I am looking for any alternatives.

So this is what I have:

qry1 is the main query. qry2 gets the value to append to the end of the string.
So the value of variable test would look like this: "variables.qry1.100"

Which would make sense to qry1 as this is part of the query object. So then this string would return a correct value from the database as there is a subquery called 100

<cfoutput>
<cfloop query="variables.qry2">
    <cfset test = variables.qry1. & variables.qry2.#valueID#>
<td>#test#</td> 
</cfloop>
</cfoutput>

Many thanks.

JC

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:16:58+00:00Added an answer on June 17, 2026 at 4:16 pm

    What your trying to do is possible, but you need to build a variable name first.

    Instead of

    <cfset test = variables.qry1. & variables.qry2.#valueID#>
    

    Try

    <cfset test = "variables.qry1.#variables.qry2.valueID#">
    

    Test will then be variables.qry1.[valueID value]. Note that [valueID value] is what is getting returned from the query, so the actual value inside the variable.

    Then to display the value of variables.qry1.[valueID value].

    #evaluate(test)#
    

    UPDATE As stated by Adam Cameron’s answer. You should really try to avoid the evaluate() function, it’s quite a performance hit and not considered good practice. Instead rather use the following code (This is copied from Adam Cameron’s answer)

    #variables.qry1[variables.qry2.valueID][1]#
    

    NOTE: Go look at Adam Cameron’s answer for a better description of whats going on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure if this is possible what I'm trying to achieve. I want
I'm trying to build something that I'm not sure if it's possible. I have
Not sure this is possible, but looking to write a script that would return
I'm not sure if this possible but probably is fairly simple. I've made a
I'm not sure this is possible, but in ruby, you can dynamically call a
I'm not sure this is possible, but is there a syntax to be used
Not sure if this is possible: I want to use datatables to manipulate my
Not sure if this is possible. I want to grab the latest X stories
Not sure if this is possible in one Makefile alone, but I was hoping
I'm not sure this is even possible but I know if it is, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.