RE: using variable list from a multiple select/form (warning: lon g)

2001-04-26 Thread GoingSideways

I figured it out!!

The answer (or at least the one I'm using):







SELECT Users.UserName
FROM Users Users
WHERE Users.UserId IN (#ListQualify(form.NOTIFY, "'")#)






 

 


Thank you to David & Matt

:-)
Oriole

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: using variable list from a multiple select/form (warning: lon g)

2001-04-26 Thread GoingSideways

Thank you so much, David!!  I'm getting closer.  This works for the query and I get 
good results.  But, depending on where I build the list, I either get two Orioles or 
two Roberts back in the Dear variable.  I need one of each (or one of how many ever 
are selected).  What am I missing?

:-)
Oriole

In a message dated Thu, 26 Apr 2001 11:02:06 AM Eastern Daylight Time, David Shadovitz 
<[EMAIL PROTECTED]> writes:

<< Something like
  WHERE Users.UserId IN (#ListQualify(form.NOTIFY,"'")#)

And then
   

-David

On Thursday, April 26, 2001 6:48 AM, [EMAIL PROTECTED] 
[SMTP:[EMAIL PROTECTED]] wrote:
> This works great if only one choice is selected.  But it chokes on multiple
> choices.  The query runs right, but comes back with zero records found.
>
> Say the call taker chooses OSAAH and RBOLTON from the email notify list.  In
> this case "#form.notify# equals 'OSAAH,RBOLTON' so iMIS is looking for
> 'OSAAH,RBOLTON' and coming up empty.  How do it get it to look for 'OSAAH'
> AND 'RBOLTON'?  And then report the two UserName(s) back to go together in
> the Dear __ line of the email as #Dear#?  The rest of the code generates one
> email that goes to both recipients.
>
> :-)
> Oriole
>
>
> In a message dated Wed, 25 Apr 2001  7:19:46 PM Eastern Daylight Time, Matt
> Eschenbaum <[EMAIL PROTECTED]> writes:
>
> << Your trying to do to many loops.  Try this and let me know if works for
> you.
>
>
>  LIST="#form.notify#"
> >
>
> 
> SELECT Users.UserName
> FROM Users Users
> WHERE (Users.UserId='#form.NOTIFY#')
> 
>
>  
>
> 
> 
>
>
> Sincerely,
>
> Matthew M. Eschenbaum
> Allaire Certified Professional
> DevTech Inc.
> [EMAIL PROTECTED]
> 206.956.0888
> www.dev-tech.com
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 25, 2001 3:45 PM
> To: CF-Talk
> Subject: using variable list from a multiple select/form (warning: long)
>
>
> Hello all,
>
> I am having trouble using a particular variable.  This is a long email
> because I am trying to provide enough information to give a clear picture of
>
> my problem (which is probably quite simple and I probably should be able to
> solve it on my own ...)
>
> I have a form variable (called "NOTIFY") which comes from a drop-down option
>
> (dynamically populated) which allows for multiple choices. The variable
> arrives on the action page (where the data is inserted in a table, that
> works
> no problem) as a comma delimited list. Once it arrives at the action page,
> it
> serves two functions.  It's email address creation function works
> beautifully.  But then I need to use it to query our membership database to
> pull out the actual name of the person so that the email message is more
> user
> friendly ... (the CN in an email address just won't do for Dear , you
> know how that goes).
>
> What I think I need to do it
> 1. Count the number of items in the list
> 2. Run it through a list loop to parse each item out as a separate variable
> 3. Run the query to the membership database to get the UserNames, using the
> newly created variables.
> 4. Run it through a query to put it back in a new variable for output in the
>
> single email that is generated.
>
> But I don't know how to count the items or run the list loop.  Can you help
> me?
>
> Here's the code for the select from the form, populated by an earlier query:
>  SIZE="8"
> MULTIPLE>
>
>#NOTIFY#
>
>No Report
> 
>
> And this is what I have in the action form, so far:
>
> 
> 
>
> 
>
>  LIST="#form.notify#"
> DELIMITERS=",">
> 
> 
> #get_count.RecordCount#
> 
> 
>  FROM="1"
> TO="#to#">
> 
> SELECT Users.UserName
> FROM Users Users
> WHERE (Users.UserId='#form.NOTIFY#')
> 
> 
>
> 
> 
> 
> 
>
> 
>
>  LIST="Notify"
> DELIMITERS=",">  (closes at the end of the mail, I have not included
>
> all of that...)
>
> 
>
> 
>
>
> @@@
>
> Help!!
>
> Special thanks in advance to anyone who has a better idea of how to do this
> than I have had so far.
>
> :-)
> Oriole
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: using variable list from a multiple select/form (warning: lon g)

2001-04-26 Thread David Shadovitz

Something like
  WHERE Users.UserId IN (#ListQualify(form.NOTIFY,"'")#)

And then
   

-David

On Thursday, April 26, 2001 6:48 AM, [EMAIL PROTECTED] 
[SMTP:[EMAIL PROTECTED]] wrote:
> This works great if only one choice is selected.  But it chokes on multiple
> choices.  The query runs right, but comes back with zero records found.
>
> Say the call taker chooses OSAAH and RBOLTON from the email notify list.  In
> this case "#form.notify# equals 'OSAAH,RBOLTON' so iMIS is looking for
> 'OSAAH,RBOLTON' and coming up empty.  How do it get it to look for 'OSAAH'
> AND 'RBOLTON'?  And then report the two UserName(s) back to go together in
> the Dear __ line of the email as #Dear#?  The rest of the code generates one
> email that goes to both recipients.
>
> :-)
> Oriole
>
>
> In a message dated Wed, 25 Apr 2001  7:19:46 PM Eastern Daylight Time, Matt
> Eschenbaum <[EMAIL PROTECTED]> writes:
>
> << Your trying to do to many loops.  Try this and let me know if works for
> you.
>
>
>  LIST="#form.notify#"
> >
>
> 
> SELECT Users.UserName
> FROM Users Users
> WHERE (Users.UserId='#form.NOTIFY#')
> 
>
>  
>
> 
> 
>
>
> Sincerely,
>
> Matthew M. Eschenbaum
> Allaire Certified Professional
> DevTech Inc.
> [EMAIL PROTECTED]
> 206.956.0888
> www.dev-tech.com
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 25, 2001 3:45 PM
> To: CF-Talk
> Subject: using variable list from a multiple select/form (warning: long)
>
>
> Hello all,
>
> I am having trouble using a particular variable.  This is a long email
> because I am trying to provide enough information to give a clear picture of
>
> my problem (which is probably quite simple and I probably should be able to
> solve it on my own ...)
>
> I have a form variable (called "NOTIFY") which comes from a drop-down option
>
> (dynamically populated) which allows for multiple choices. The variable
> arrives on the action page (where the data is inserted in a table, that
> works
> no problem) as a comma delimited list. Once it arrives at the action page,
> it
> serves two functions.  It's email address creation function works
> beautifully.  But then I need to use it to query our membership database to
> pull out the actual name of the person so that the email message is more
> user
> friendly ... (the CN in an email address just won't do for Dear , you
> know how that goes).
>
> What I think I need to do it
> 1. Count the number of items in the list
> 2. Run it through a list loop to parse each item out as a separate variable
> 3. Run the query to the membership database to get the UserNames, using the
> newly created variables.
> 4. Run it through a query to put it back in a new variable for output in the
>
> single email that is generated.
>
> But I don't know how to count the items or run the list loop.  Can you help
> me?
>
> Here's the code for the select from the form, populated by an earlier query:
>  SIZE="8"
> MULTIPLE>
>
>#NOTIFY#
>
>No Report
> 
>
> And this is what I have in the action form, so far:
>
> 
> 
>
> 
>
>  LIST="#form.notify#"
> DELIMITERS=",">
> 
> 
> #get_count.RecordCount#
> 
> 
>  FROM="1"
> TO="#to#">
> 
> SELECT Users.UserName
> FROM Users Users
> WHERE (Users.UserId='#form.NOTIFY#')
> 
> 
>
> 
> 
> 
> 
>
> 
>
>  LIST="Notify"
> DELIMITERS=",">  (closes at the end of the mail, I have not included
>
> all of that...)
>
> 
>
> 
>
>
> @@@
>
> Help!!
>
> Special thanks in advance to anyone who has a better idea of how to do this
> than I have had so far.
>
> :-)
> Oriole
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: using variable list from a multiple select/form (warning: lon g)

2001-04-26 Thread GoingSideways

This works great if only one choice is selected.  But it chokes on multiple choices.  
The query runs right, but comes back with zero records found.

Say the call taker chooses OSAAH and RBOLTON from the email notify list.  In this case 
"#form.notify# equals 'OSAAH,RBOLTON' so iMIS is looking for 'OSAAH,RBOLTON' and 
coming up empty.  How do it get it to look for 'OSAAH' AND 'RBOLTON'?  And then report 
the two UserName(s) back to go together in the Dear __ line of the email as #Dear#?  
The rest of the code generates one email that goes to both recipients.

:-)
Oriole


In a message dated Wed, 25 Apr 2001  7:19:46 PM Eastern Daylight Time, Matt Eschenbaum 
<[EMAIL PROTECTED]> writes:

<< Your trying to do to many loops.  Try this and let me know if works for you.



 

SELECT Users.UserName
FROM Users Users
WHERE (Users.UserId='#form.NOTIFY#')


 





Sincerely,

Matthew M. Eschenbaum
Allaire Certified Professional
DevTech Inc.
[EMAIL PROTECTED]
206.956.0888
www.dev-tech.com



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 3:45 PM
To: CF-Talk
Subject: using variable list from a multiple select/form (warning: long)


Hello all,

I am having trouble using a particular variable.  This is a long email 
because I am trying to provide enough information to give a clear picture of

my problem (which is probably quite simple and I probably should be able to 
solve it on my own ...)

I have a form variable (called "NOTIFY") which comes from a drop-down option

(dynamically populated) which allows for multiple choices. The variable 
arrives on the action page (where the data is inserted in a table, that
works 
no problem) as a comma delimited list. Once it arrives at the action page,
it 
serves two functions.  It's email address creation function works 
beautifully.  But then I need to use it to query our membership database to 
pull out the actual name of the person so that the email message is more
user 
friendly ... (the CN in an email address just won't do for Dear , you 
know how that goes).

What I think I need to do it
1. Count the number of items in the list
2. Run it through a list loop to parse each item out as a separate variable
3. Run the query to the membership database to get the UserNames, using the 
newly created variables.
4. Run it through a query to put it back in a new variable for output in the

single email that is generated.

But I don't know how to count the items or run the list loop.  Can you help 
me?

Here's the code for the select from the form, populated by an earlier query:

   
   #NOTIFY#
   
   No Report


And this is what I have in the action form, so far:









#get_count.RecordCount#
 


SELECT Users.UserName
FROM Users Users
WHERE (Users.UserId='#form.NOTIFY#')










  (closes at the end of the mail, I have not included

all of that...)






@@@

Help!!

Special thanks in advance to anyone who has a better idea of how to do this 
than I have had so far.

:-)
Oriole
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: using variable list from a multiple select/form (warning: lon g)

2001-04-25 Thread Matt Eschenbaum

Your trying to do to many loops.  Try this and let me know if works for you.



 

SELECT Users.UserName
FROM Users Users
WHERE (Users.UserId='#form.NOTIFY#')


 





Sincerely,

Matthew M. Eschenbaum
Allaire Certified Professional
DevTech Inc.
[EMAIL PROTECTED]
206.956.0888
www.dev-tech.com



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 3:45 PM
To: CF-Talk
Subject: using variable list from a multiple select/form (warning: long)


Hello all,

I am having trouble using a particular variable.  This is a long email 
because I am trying to provide enough information to give a clear picture of

my problem (which is probably quite simple and I probably should be able to 
solve it on my own ...)

I have a form variable (called "NOTIFY") which comes from a drop-down option

(dynamically populated) which allows for multiple choices. The variable 
arrives on the action page (where the data is inserted in a table, that
works 
no problem) as a comma delimited list. Once it arrives at the action page,
it 
serves two functions.  It's email address creation function works 
beautifully.  But then I need to use it to query our membership database to 
pull out the actual name of the person so that the email message is more
user 
friendly ... (the CN in an email address just won't do for Dear , you 
know how that goes).

What I think I need to do it
1. Count the number of items in the list
2. Run it through a list loop to parse each item out as a separate variable
3. Run the query to the membership database to get the UserNames, using the 
newly created variables.
4. Run it through a query to put it back in a new variable for output in the

single email that is generated.

But I don't know how to count the items or run the list loop.  Can you help 
me?

Here's the code for the select from the form, populated by an earlier query:

   
   #NOTIFY#
   
   No Report


And this is what I have in the action form, so far:









#get_count.RecordCount#
 


SELECT Users.UserName
FROM Users Users
WHERE (Users.UserId='#form.NOTIFY#')










  (closes at the end of the mail, I have not included

all of that...)






@@@

Help!!

Special thanks in advance to anyone who has a better idea of how to do this 
than I have had so far.

:-)
Oriole
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists