How to use cfloop index value as part of another variable

Hello,
I have a RATE form that first asks "how many rates will you
be adding?" that answer generates a series of form elements based
on the answer. You then have a form grid to populate, 3 values for
each rate (price, code, name).
This part works fine. The issue is now I need to INSERT the
values into the table, so I need to use the INDEX value of the
cfloop to recreate the amount (and names) of the fields in the
INSERT statement. How do I escape, or re-create the evaluated form
elements ( in which their count is #i# as the loop goes) when I
need to evaluate for #i# AND evaluate for #form.sku_i_name# at the
same pass?
I am passing, for example, #form.sku_2_Name# where that might
equal "Half Page". The number 2 in that variable was assigned
during the form creation by the current index of a cfloop. Since my
action (insert) page does not know how many (out of 50 possible)
sku's are coming, how do I use the skuCount (another hidden value
passed as well) to create a proper INSERT SQL command when I need
to eval the form element and the index at the same time?
Obviously #sku_#i#_Name# does not work, and #sku_i_Name# does
not either... I know this can be done, and that I am just doing it
wrong.
Thanks for any help!

bigbrain28 wrote:
> Thank You, cfsearching! I don't quite understand 100%
how it works
As all three of us indicated you use array notation for this
type of
requirement. In ColdFusion you can use array notation or dot
notation
to access structure data. Almost all data in ColdFusion is
now some
type of structure.
I.E. #Form['myField']# is the same as #Form.myField#.
The advantage is that with array notation you can do things
you can not
do with dot notation. You can reference elements that have
keys that
are illegal variable names such as one with a space.
I.E. #url['my field'] is allowed, #url.my field# would fail
or course.
And you can concatenate the key string as we did with your
example.
I.E. #Form['aString' & aVariable]#
There are many powerful things one can do with this
knowledge. One can
access record sets with array notations. This can allow for
very
sophisticated parsing of a record set.
I.E. #myQuery['column'][row]#
You can dynamical call a variable. Thus creating dynamic code
that does
not even need to know what variables exist until run time.
I.E. #variables[anyName]#
This just scratches the surface.

Similar Messages

  • How do I use the Index Values property node with a multidimensional array.

    I am using a 2D array to store operator inputs on my front panel.  I only want to display one element to the operator at a time.  I am trying to use the Index Values property node to change the displayed element.  However, I can only get the Rows index to work.  How do I direct the Columns index as well?  The help says to use one per dimension.  I need clarification on what this is talking about.  I've tried adding a second element to the property node, 2 seperate property nodes, and diferent wiring techniques. (series, parallel)

    If you only wire up one of the inputs (col or row) what you get out is a 1D array of either the column or row. If you wire controls to both, then you will get one element out of the array. Getting a single element in a 2D array requires you to specify both a row and column.
    Message Edited by Dennis Knutson on 02-08-2007 08:34 AM
    Attachments:
    Index 2D Array.PNG ‏2 KB

  • How to use the index method for pathpoints object in illustrator through javascripts

    hii...
    am using Illustrator CS2 using javascripts...
    how to use the index method for pathpoints object in illustrator through javascripts..

    Hi, what are you trying to do with path points?
    CarlosCanto

  • How to use the prompted value in the filter expression

    Hi
    Is it possible to use the prompted value in the filter expression?
    My requirement is that user will be prompted for a date field and I need to filter the records such that the records are displayed for the last 5 weeks from the date entered by the user.
    If somehow I know how to use the prompted value in the filter expression then this requirement is easy to be done. If this is possible, please guide me?
    If there are other ways to acheive the desired results then please suggest.
    Thanks
    -Jaz

    Edit: example added
    SQL> create table tb_test
      2  ( id number(5)
      3  , tot number(5)
      4  , mon_tot number generated always as (tot*15) virtual
      5  );
    Table created.
    SQL> insert into tb_test (id, tot) values (1, 5);
    1 row created.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1          5         75
    1 row selected.
    SQL> update tb_test
      2  set    tot = 15
      3  where  id = 1;
    1 row updated.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1         15        225
    1 row selected.

  • How to use a cumulative value in a formula

    hi, experts
    I have a question about how to use a cumulative value in a formula. Below is the example:
                            wk1   wk2   wk3   wk4   wk5....wk n
    sales order        5       10    15      10      5
    build plan          8       8     10      15     10
    result                3       1      -4       1       6
    result row is what I want to get, the formula is:
    wk1 result = wk1 build plan - wk1 sales order
    wk2 result = wk1 build plan + wk2 build plan - (wk1 sales order  + wk2 sales order)
    wk3 result = wk1 build plan + wk2 build plan + wk3 build plan - (wk1 sales order  + wk2 sales order + wk3 sales order)
    I've already ticked the cumulative in properity of the key figures. It seems like that the cumulative results only can display, but can't be used in formula. Could you please help me? Many many thanks !!

    Hi
    In properties of that formula, there is option called 'formula collision' there you select 'formula from compiting result'. I think this will solve the problem.

  • How to use secondry index

    Hi Experts,
    I have a requirement to improve the performance of report,So i got some select querys there non primery keys are used for table VBAK,VBAP,LIKP,LIPS so i want to create secondry index for that,Any one can help me for that means after create secondry index how to use that index in report and for create secondry index required any MANDT field or Not.
    Thanks.

    Hello Ram,
    Before creating secondary index you need to know the below points.
    1) Do not create more indices on table
    2) What is the frequency of table access
    3) You should not create too much columns(should be less than 120 characters)
    4) Cant you use existing indices?
    5) DML operation will be delayed if you create index
    Before moving to Production system please consider below the points.
    1) Ask BASIS to create index in DB level then move your DDIC transport which will be faster
    2) While creating index if the DB size is like more than 500 GB then downtime is required
    Regards,
    Vadamalai A

  • How can i pass the value one from to another form?

    hi all
    how can i pass the value one from to another form  with out use it when ever i want to needed this value that ican useit?
    like i have two fields U_test1 and U_test2  table name @AUSR
    that i have  four form  A! , A2,A3,A4    please tell me in details....?

    Hi,
    U can assign the values to some variables and access then in ur required forms.
    Vasu Natari.

  • How to get the index value from rich:dataTable in jsf2.0

    hi,
    I am developing web application using jsf2.0. In this case, I used rich:dataTable tag for display the values from mysql.
    so this is working..
    my problem is, How to select the perticular row or index from the datatable for another processing...
    help me..
    Thanks.

    Hi,
    You need to get the selectedIndex attribute of the drop down element, e.g.
    String ind = web
                   .element(
                        41,
                        "/web:window[@index='0' or @title='Our Business Web Site']/web:document[@index='4' or @name='optBody']/web:form[@name='frmOptions' or @index='0']/web:select[(@name='PathLen' or @index='2')]").getAttribute("selectedIndex");
    System.out.println("Drop down index is: " + ind);
    You can use the Object Browser to get the path to the element you are interested during recording.
    Regards,
    Jamie

  • How to use an index

    Hi,
    Can someone tell me how can I use a index of row?
    I want to see if any value is repeated in a column something like
    declare
    x number;
    type my_table is table of number;
    var_c1 my_table;
    begin
    for i in 1..6 loop
    select round(dbms_random.value(1, 49),0) bulk collect into var_c1 from dual;
    if var_c1(i) = var_c1(i).next then
    dbms_output.put_line(var_c1(1));
    end if;
    end loop;
    end;
    thank you

    I am sorry but I do not understand the question.
    If you want to see if each row is unique just try and create a unique index on the column or select column_name, count(column_name) group by column_name order by 2 or something similar.
    John
    www.jhdba.wordpress.com

  • How to use the updated value in the same update statement

    Hello,
    I just wonder how to use the updated new value of other column in the same udpate statement. I am using Oracle 11.2, and want to update the two columns with one update statement as following:
    create table tb_test (id number(5), tot number(5), mon_tot number(5));
    update tb_test set (tot = 15, mon_tot = tot *15) where id = 1;
    ...I would like to update both tot and mon_tot column, the value of mon_tot shall be determinted by the new value of tot.
    Thanks,
    Edited by: 939569 on 1-Feb-2013 7:00 AM

    Edit: example added
    SQL> create table tb_test
      2  ( id number(5)
      3  , tot number(5)
      4  , mon_tot number generated always as (tot*15) virtual
      5  );
    Table created.
    SQL> insert into tb_test (id, tot) values (1, 5);
    1 row created.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1          5         75
    1 row selected.
    SQL> update tb_test
      2  set    tot = 15
      3  where  id = 1;
    1 row updated.
    SQL> select * from tb_test;
            ID        TOT    MON_TOT
             1         15        225
    1 row selected.

  • How to use copy default values for material from vendor master in Account Group

    Dear all:
       In define AccountGroup for vendor ,there is a field named DURAS which means default values,who can tell me how to use it?
       Any informations are appreciated!

    Hi Katherine,
    I have tried using default value as B in the customizing
    If i maintain default values in the vendor master record, it will automatically adopt in the purchase info record.
    Here i tried using sales person & telephone no field in vendor master record & it automatically adopts to purchase info record.
    Region sales person and telephone no i have maintained in vendor master record, it automatically fetches to info record for the particular account group. I am not sure if there is any relation between vendor master and material master record.
    Regards
    Subbu.

  • How to use Browsing Index

    Hi, I want to speed up a search that return a large number of users. For what I understood I need to create a Browsing index. I've created a browsing index following instruction on the Admin manual, but I really don't understand how to use it ?
    After creating the index (ldapmodify + vlvindex), are this index used by default if the search mach the vlvbase and vlvfilter ?
    Thanx

    Sorry I don't know why I don't see the [notes=u] in the access log but it seam the my vlv is not created at all.
    When i run vlvindex I get the following error:
    [18/Feb/2005:12:28:01 +0100] - userRoot: Indexing VLV: Sort SN
    [18/Feb/2005:12:28:02 +0100] - userRoot: Indexed search unsuccessful, will perform unindexed search instead.
    No vlv#.... files are created in the db directory, so I think no vlv index are created..

  • How to use the prompt value in the report column

    Hi
    I have a report prompt column which is 'Adj Type' which holds values 10,20,30 and when user selects Adj Type = 10 then this value should be passed to report column.
    For Eg. Column 1 value is 10 and this should multiple with prompt value and the output should be 10* 10.
    Any thoughts how to capture the prompt values in report column for calculation.

    hi hsekar,
    1) Declare a presentation variable in prompt under the Set Variable section -->Presentation Variable -->P_var
    2) In Fx Table_name.Your_column * @{P_Var}
    @{P_var}{20} ( 20 is default value it will override when a user selects value in prompt
    Thanks,
    Saichand.v

  • How to use a table- valued function as a datasource for SSRS report?

    CREATE FUNCTION [dbo].[GetNetSheetRegionNetPerCapitaRow](@WeekBeginDate smalldatetime)
    RETURNS @RegionNetPerCapitaRow TABLE 
    (WTD1 DECIMAL(18,6),PYWTD1 decimal(18,6),percentDiff1 float,diff1 float,WTD2 decimal(18,6),YTD2 decimal(18,6),percentDiff2 float,Diff2 float,YTD3 decimal(18,6),PYTD3 decimal(18,6),percentDiff3 float,Diff3 float)
    how to use the above function as a data source for SSRS report instead of a stored procedure ?

    Hi,
    In the Dataset - > Query Type - >  Text - >
    SELECT * FROM [dbo].[GetNetSheetRegionNetPerCapitaRow](@WeekBeginDate)
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

  • How to use interface return value in workflow task

    Hi all,
    My team developed a proxy(interface) to fetch a field from web application(Non SAP) through PI. i tested that interface in SAP, its working fine. Interface is having one input, one output.
    Input - from SAP(employee number)
    Output - from webapplication (manager number).
    In my workflow, i have to use that manager number in decission task. For that i created a task, but in that task, iam unable to use the class and method name which is mentioned above. its giving an error "Interface implementation IF_WORKFLOW does not exist".
    Please guide me, how to use that interface output in my workflow.
    Regards
    Arani Bhaskar

    "Interface implementation IF_WORKFLOW does not exist".
    This error is triggered because the class which you are using in the task does not have included and implemented the interface IF_WORKFLOW , if at all you want to use any class methods in the workflow, then that class must supprot the interface IF_WORKFLOW
    what you can do is 
    1. Include the interface IF_WORKFLOW in the class that you are using to fetch the manager number,
    2. Make the method as Static Method .
    3. Just implement all the methods , I mean just double click each method of the interface, clcik on pretty printer and save it, to just implement all the methods.
    3. Do the appropriate bindings .
    And finally just execute the txn SWU_OBUF and click Shift+F1.
    this will help you to retrive the manager number intot the workflow

Maybe you are looking for

  • How do I synchronise ical on my new macbook air?

    I just got a mcbook air and I don't know how to synchornise ical. I have a mobile me account, so I want to synchronise ical from my iphone to my macbook air directly. How to do this. Thank you.

  • Installation Problems Oracle Portal3.0 Linux 8.1.6

    The installation finshed with Errors: SSO Hast WWSEC_Enabler_Config_Info Now I can start the welcome Page of Portal. But if i try to logon, i get the following error message: You cannot login because there is no configuration information stored in th

  • Why do certain webpages load on my Macbook, but others won't?

    I have a Macbook Pro (mid-2012) that's running on Mountain Lion (10.8.2). Recently, I have had trouble connecting to certain websites. I can connect quickly and easily to Outlook, Google, Tumblr Sites such as Facebook, YouTube and Netflix will not lo

  • From deep structured to flat itab

    Hi experts! I need to copy three columns from an internal table <u>itab_upload</u>. I defined the structure for it in the DDIC. It contains 5 columns and another table(<u>Itab_note)</u> for possible entries. For a report I need to copy 3 columns of t

  • Change of field order obtained from getFields()

    I use getFields() method of 'Class' to obtain the fields of a class. Fields returned from method are in order they are declared but according to documentation this order is not guaranteed. The elements in the array returned are not sorted and are not