Automatically fill cells from reference table

Not sure if this is even possible, but I thought I'd ask and see if anyone knows of a way to do this. Here goes.
Can I have cells fill in information automatically from a reference table in another sheet? What I'm trying to do is this:
I need to keep training records for a group. What I've created is a numbers document with two sheets. In the first sheet, I have a single table with two columns that lists all of the training courses in column B with their course codes in column A. For example, let's say that course C32 (listed in Column A) is a "Basic Training" course (so "Basic Training" is in column B). On the next row is the next course, the next row is the next course, etc. This is my reference table.
Now in the second sheet, I have a table for each person. Each table is three columns. In the first I enter the course code they've taken, in the second I enter the date they took it, and what I'd LIKE to have happen is that when I enter the course code in Column A, the description from the reference table automatically fills into the third column. That way I don't have to type all the course descriptions over and over. (Some of them are fairly lengthy).
Is there any way to do this in numbers?
Thanks

Yes, it is possible. Use the LOOKUP function. However, your lookup table must be in the same document, but can be on a separate sheet.
Create a table of the course names (2 columns, code in A and name in B) and call the table (not the containing sheet) something significant such as "Course names". Then in Column C of each persons table use the formula =LOOKUP(A, Course Names :: A, Course names :: B). This says take the code reference from the first cell on the line (local column A) and compare it with the codes in the first column (Course names :: A) of the Course names table, and return the value from the second column (Course names :: B) of the matching row.
Remember to enter the formula as a column formula to save having to repeat it in each cell.

Similar Messages

  • How to dynamically copy cells from different tables?

    Hi,
    I've created an invoice and have 2 different tables. First is at top with Recipient information, the invoice number, their address, etc. Below that, I have a 2nd table laying out the items they are being charged for.
    I would like to copy the invoice number from the 1st table, to a cell in the 2nd table or a 3rd table I will create later on. I know how to copy cells in 1 table, ie. =D4. But not sure how to target a different table altogether.
    Also, is it possible to copy a cell from 1 table to a text box field?
    Thanks!!

    Yvan's point is true.  Please use the User Guides first; they're actually pretty readable.
    However, there's a very quick & easy way to try it out as well.  Go to the cell where you want your data to end up.  Type "=" (without quotes) to indicate you're going to input a formula of some kind.  Then without clicking inside any tables, use the list of sheets and tables to the left to get to your source table and click on the cell that contains the data you want to copy.  Presto!  Go back to your destination cell, and the formula is now filled in, following the scheme Yvan provided.
    Vince

  • I want to reference a cell from another table and fill it with text

    I I have several tables that update each other with data from the previous one. These tables are identical and follow each other by date. In each table is a cell (B1) where a persons name goes. the cell (B2) references another cell from a previous dated table. Some days, consecutively, no name is entered in to cell B1. I want cell B2 to always refer back to the most recent table with a name is cell B1. How can this be done?
    I have written this formula (applied to cell B2 of this example) already: IF(Day 1::B1="","",IF(Day 1::B1≥"",Day 1::B1))  but it only references the previous days table and stops there. Some days nothing is inputed into cell B1 causing causing the following days table cell B2 to show "0".
    Monday, April 1
    Driver
    Driver for Today
    David
    Previous Driver (Last person to drive vehicle)
    Tuesday, April 2
    Driver
    Driver for Today
    Previous Driver (Last person to drive vehicle)
    David
    Wednesday, April 3
    Driver
    Driver for Today
    Mike
    Previous Driver (Last person to drive vehicle)
    David
    Thursday, April 4
    Driver
    Driver for Today
    Previous Driver (Last person to drive vehicle)
    Mike
    Friday, April 5
    Driver
    Driver for Today
    Previous Driver (Last person to drive vehicle)
    Mike
    Saturday, April 6
    Driver
    Driver for Today
    Carl
    Previous Driver (Last person to drive vehicle)
    Mike
    Sunday, April 7
    Driver
    Driver for Today
    David
    Previous Driver (Last person to drive vehicle)
    Carl

    "I am having trouble getting the formulas you suggested to work. I am not sure where the problem is coming from. Could you look at the following spreadsheet and tell me where I am going wrong? The following pic shows Day 1 and AUX tables. In Day 1 cell B1 a Drivers name is entered. As you can see by the formula that you gave the B2 is for "Product" not the drivers name "David"."
    Hi br,
    The formulas provided above apply directly to the set of tables shown with them. In each of these tables, the target cell, containing the name of the driver for that day is cell B2 on the table for that day.
    For Day 1, the driver is Huey, found in cell B2 of Table 1, and the cell reference to retrieve the information from that cell is =Table 1::B2
    The formula in B2 of Aux uses INDIRECT to build that cell reference from the fixed text string "Table ", the calculated value ROW()-1, and the text string "::B2"
    ROW() returns the number of the row in which the function sits. In B2, that's row 2, and ROW() returns 2. -1 subtracts 1 from that value, leaving 1. In B2, ROW()-1 returns 1.
    The ampersand is the concatenation operator. It joins the value before it to the value following it. The result is a text string. in the INDIRECT part of the formula, there are two & operators, one after "Table ", the other after ROW()-1.
    "Table " & ROW()-1 & "::B2" with the result of ROW()-1 as the value between the two text strings.
    "Table " & 1 & "::B2"   =   "Table 1::B2"
    INDIRECT( ) takes that text and converts it to the cell address that it represents.
    B2: =IF(LEN(INDIRECT("Table "&ROW()-1&"::B2"))<1,"",INDIRECT("Table "&ROW()-1&"::B2"))
    The first instance on the string in the formula is a test to see if there is anything in the target cell. If not, the formula returns a null string. If there is at least 1 character there, the second instance of INDIRECT is called on to return the name to B2 of the table Aux.
    Compare your formula below:
    B4: =IF(LEN(INDIRECT("Day 3"&ROW()-1&"::B2"))<1,"",INDIRECT("Day 3"&ROW()-1&"::B2"))
    As shown, this is the formula in B4 of your Aux table. In Row 4, ROW() returns 4, and ROW()-1 returns 3.
    So the three elements of the cell address constructed in INDIRECT are "Day 3", 3, and "::B2"
    The cell being addressed is "Day 33::B2", cell B2 on the table named Day 33.
    The error results from there being no table with that name.
    The fix (to the table part of the reference) is to change the first text string to "Day " (including the space after the word Day).
    The fix to replace Product with the driver name is to change "::B2" to ::B1"
    To fit the names of your day tables and the location of the driver's name on each, your formula in B2 should read:
    B2: =IF(LEN(INDIRECT("Day "&ROW()-1&"::B1"))<1,"",INDIRECT("Day "&ROW()-1&"::B1"))
    Regards,
    Barry

  • How to fill cells from a maximum to minimum

    Hi very simply if I have a column of twenty cells and in cell 1 I put the number 1 and in cell 20 I put the number 20 is there a way numbers can automatically fill the cells 2-19 with the appropriate increments?  I know you can drag a corner of two cells and it will continue the pattern but I have two values in mind an upper and a lower and want to fill the gap between the two.
    Thanks

    "I wanted to award the top mark of 20 points and slowest time or more of 1 point and just spread the gap evenly across points 2-19."
    How does a participant get a time that is "more" than the "slowest time"? (see NOTE appended)
    Using the described method of assigning points, here's an example.
    For two races, each with three competitors, the points awarded could be (rounded or truncated from) the calculated values below:
    Note that the 'best' times and the 'second best' times in both races are the same. Only the time of the slowest runner (and the consequent score of the 'second best') are different.
    If the (huge) difference in score for an identical performance when compared with the winning time is acceptable, here's a solution that will calculate those results directly from the list of times (in seconds, expressed as a decimal number).
    Notes:
    Columns C, D and E are independent calculations, each using the in column B. C shows the raw point value; D shows the same calculation with the result truncated to show only the integer part, E shows the same calculation with the result rounded to the nearer integer value. See the scores for Runners 4, 7, 9 (and others) for differences when reducing the point values to whole number values.
    For test and demonstration purposes, I entered the fastest and slowest times in the first two cells of column B, and generated the rest using the RANDBETWEEN function. The entered scores can be in any order. Runners who did not participate, or did not finish should have their column B cell left empty.
    Formulas: The three formulas are identical except for truncating or rounding parts (shown in bold). Pick the one that best suits your needs. They're placed in the top row containing race times, and filled down from there.
    C2: =IF(LEN(B)>0,1+19*(MAX(B)-B)/(MAX(B)-MIN(B)),"")
    D2: =IF(LEN(B)>0,INT(1+19*(MAX(B)-B)/(MAX(B)-MIN(B))),"")
    E2: =IF(LEN(B)>0,ROUND(1+19*(MAX(B)-B)/(MAX(B)-MIN(B)),0),"")
    Regards,
    Barry
    NOTE: Your mention of 'the slowest time or more' might offer a way around the score variation noted above. The organization governing F1 racing introduced a new rule recently restricting qualifying times to those less than seven per cent slower than the fastest time in the qualifying rounds. A similar rule, defining a floor value at and below which finishers will be awarded a single point would also make points above that floor dependent only on the runner's performance relative to the race winner.
    Here's an example, using the same three-runner races shown above, but with the 'floor' set at 50% more than the winning time.
    Formula (in row 2, then filled down)
    B2: =IF(LEN(A)>0,IF(A>1.5*MIN(A),1,1+(19)*(1.5*MIN(A)-A)/(1.5*MIN(A)-MIN(A))),"")
    Copied to column D, the A references are replaced with D.
    Conversion to integer values would use the same modifications as shown above.
    The results seem a fairer reflection of the second and third place times wrt the winning times in the two races.
    B.

  • Can VLOOKUP, OFFSET, INDEX and MATCH be used to SUM the value of cells from multiple tables?

    I have a problem thats needs a sulution. I have a Spreadsheet with multiple sheets and tables. The (Truck ) Sheets each represent a "Site" and the tables within from 1-31 show inventory counts for each day of the month.
    Shown below are Edited example's of a "Site" sheet and the Day tables contained within it.
    The Spreadsheet expands as a new "Site" (Truck ) is added regularly. Currently there are 30 "Sites" (Trucks).
    Also within the spreadsheet is a sheet (Checkpoint) which contains tables used to show summary data for each "Site" sheet. There is one table used to review one site, so currently there are 30 tables identical in format and structure reviewing 30 sites.
    An edited example of the summary table for Truck 1 is shown below.
    The table's in CP reference data within cells from other sheets. A LEN INDIRECT formula
    =IF(LEN(INDIRECT("Truck 1::Day "&COLUMN(cell)−3&"::K53",addr-style))<1,"",INDIRECT("Truck 1::Day "&COLUMN(cell)−3&"::k53",addr-style))
    was used to retrieve the values within certain cells. This formula works perfectly because when I add another "Site" I simply need to Dupicate a "Site" Template Sheet and then Copy Paste the LEN INDIRECT formula in to the newly created Summary table. 
    There is another sheet (Command Central) which contains a Master summary table. The Master Summary sheet is identical in structure to the CP Summary Tables. Its purpose is to show the combined data from the tables within Checkpoint (Truck 1-30). for instance MS::D5=Checkpoint::Truck 1:Truck 30::D5. I realize that Numbers cannot calculate cells within a range of table so I am hoping for a workaround. 
    Could someone please help me with a formula something like the LEN INDIRECT formula mentioned above or possible a something else that could work beside
    D5=Truck 1::D5,Truck 2::D5,Truck 3::D5...?
    When I use that formula type I will have to edit the formula every time I add a new site.
    Anothe issue Im having is getting D3:AH3 to show the correct count of names. I am using the following formula:
    D3=SUM(COUNTA(Truck 1::D3,Truck 2::D3,Truck 3::D3,Truck 4::D3))−SUM(COUNT(UNION.RANGES(Truck 1::D3,Truck 2::D3,Truck 3::D3,Truck 4::D3)))
    The cells it is counting are either blank (the refenced cell contains a LEN INDIRECT formula that places "" if needed) or contain a name. This formula works when I and addressing cells without the LEN INDIRECT formula. What am I doing wrong?

    Hello Wayne,
    Here are screenshots of the tables in question. The first on is the Master summary table.
    Cell D5 shows the value pulled from Checkpoint::Truck 1::D5
    Cell E5 shows the value pulled from Checkpoint::Truck 2::D5
    Cell F5 shows the value pulled from Checkpoint::Truck 3::D5
    Cell G5 shows the value pulled from Checkpoint::Truck 4::D5

  • Automatic copying row from one table into another one

    Hi,
    I am looking for some help on how to do the following:
    I use Number to track my finances. I have two tables - one for my checking account and the other one for my cash account. When I withdraw cash from my checking account I record a transfer or debit transaction in my checking account table (in the type column of this table I enter "transfer" and in the category column of this table I enter "cash account"); Obviously I have to record a matching transaction in my cash account where the category column shall read "checking account". Both records represent one and the same transaction. In order not to enter this transaction twice I would like to "automate" this process so that once I enter the transaction in either of the two table (checking or cash) the matching entry automatically appears in the other table. Is there any way to do this.
    Thank you,
    Evgeny

    You can use Connection#getMetaData() to retrieve information about the tables and the columns of the table.
    After all, it is better to gain information about the table first and then issue a query in the form of "INSERT INTO table1 SELECT * FROM table2", including the eventual column selections and/or data conversions at SQL level.

  • Fill Variables From a Table

    I have a requirement to write a query which is much like an aged debt report.
    I would have a number of variables which will allow the user to create buckets of data, i.e. invoices that are not yet due, 30 days overdue, 60 days overdue, 90 days overdue, etc. However, the data will be coming from CRM, and I would like to pre-fill the variables from a table, and not have the user enter them every time they wish to run the query. The table containing the variable values will also be extracted from CRM into BW.
    Does anybody have any idea how I can pick the bucket parameters up to use in my query?

    Stuart,
    if you know already how to build and fill this kind of variable (but for other purpouse), you start from a very good point !!!
    It's enough to do a select onto the table on which you pass the relevant values (do you need some ABAP sample ? with the search engine you can find a lot of good example) ...or do you have problem to pass these values from CRM environment...let us know if you need some more specific!
    Bye,
    Roberto
    (about point, I think it's enough to hit the radiobutton that you should find in every answer...if there is some problem, write an e-mail to [email protected] or wait for some minute..)

  • Programmatically pick a cell from a table

    Hello
    Programming in XCode.
    I have a table in view.
    I have a shake detection implemented.
    Now I want that, as you shake the device, a random cell is picked from the table as the new one that is selected.
    I have a random number for the row generization which doesn't exceed the list count.
    Now I want to execute something to pick, to highlight the randomly generated row of choice.
    I hav no idea what command or call to use.
    Please help!
    Kind Regards,
    Jan

    This does the job of setting an indexpath right. (randomrij is randomrow, eentabelview is atableview)
    NSIndexPath *scrollIndexPath = [NSIndexPath indexPathForRow:randomRijinSection:0];
    [[self eenTabelView] scrollToRowAtIndexPath:scrollIndexPathatScrollPosition:UITableViewScrollPositionNone animated:NO];
    Still nothing changes in the view, the row isn't made active.
    Should there be extra code to make it happen or is there something wrong with these two lines of code given here.
    For example, do there exist multiple NSindexPaths and did I set some virtual IndexPath to the random row.

  • Automatically Filling Cells in Numbers

    I need help. I thought I might be able to figure this out myself, but it's beyond me. I'm not even sure if I'm using the right terminology, so here's what I want to do in plain English:
    In a simple invoice table, I want to be able to type in my product number in one cell and have the product description and unit price fill in automatically in adjacent cells. I assume I'll have to have a sheet with this product numbers, descriptions and unit prices on another sheet to reference.
    Advice? If you've done this, can you tell me how or send me your form so I can copy what you've done?

    What you need is to use the VLOOKUP function.
    Many examples where already posted.
    Search in the existing threads with the keyword VLOOKUP to get them.
    Yvan KOENIG (from FRANCE mardi 24 février 2009 20:55:50)

  • How to add a cell from 2 different tables in 2 different Matrix(s) that reside on the same rdlc report?

    Hello Community
        Using Visual Studio 2008 I have created a Windows Forms Application in which I created
    Embedded Reports (rdlc).
        The embedded reports (rdlc) uses Matrix(s).
        Now on this one rdlc I have dragged 2 Matrix(s) onto the body.
        One of the Matrix datasource dataset name and table name is "DataSet1_Table1.
        A cells in the Matrix has a total column on the end as follows:
    =FormatNumber(Sum(Fields!fld1.Value)+Sum(Fields!fld2.Value)+Sum(Fields!fld3.Value)+Sum(Fields!fld4.Value)+Sum(Fields!fld5.Value),"0")
        The other Matrix datasource dataset name and table name is "DataSet2_Table2.
        The cell in this Matrix has a total column on the end as follows:
    =Sum(Fields!fld1.Value)+Sum(Fields!fld2.Value)+Sum(Fields!fld3.Value)+Sum(Fields!fld4.Value)+Sum(Fields!fld5.Value)
        As you can see each Matrix has a different table.
        I would like to add the total columns from each table in each Matrix but I haven't been
    able to do it successfully. If I have to drag another Matrix or a Textbox on the
    body to do it that is okay and/or add another/different formula to a cell onto the body that is
    okay too.
        So my question is how can I add the contents of the total in cell from each table in each matrix
    which will create the "grand total"?
        Thank you
        Shabeaut

    It is possible to reference SSRS elements directly using the ReportItems collection. If your total tablix cell is outside of yoour matrix groups, you can use this collection to accomplish what you want:
    =ReportItems!Matrix1Total.Value + ReportItems!Matrix2Total.Value
    where Matrix1Total and Matrix2Total is the name of the cell that contains your totals. Note that for this to work, the cell name must be unique. If the total cell is inside a group, it will be repeated once for each instance of the group and will not be
    unique.
    You may be able to do it using the Sum aggregate and specifying the dataset for the scope variable:
    =Sum(Fields!fld1.Value, "DataSet1")+Sum(Fields!fld2.Value,
    "DataSet1")+Sum(Fields!fld3.Value,
    "DataSet1")+Sum(Fields!fld4.Value,
    "DataSet1")+Sum(Fields!fld5.Value,
    "DataSet1")+Sum(Fields!fld1.Value,
    "DataSet2")+Sum(Fields!fld2.Value,
    "DataSet2")+Sum(Fields!fld3.Value,
    "DataSet2")+Sum(Fields!fld4.Value,
    "DataSet2")+Sum(Fields!fld5.Value,
    "DataSet2")
    This will work as long as you are not filtering the dataset in your Matrix properties. If you are, those
    filters will not apply to this expression and the numbers will not total correctly.
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Get cell value from Woodstock table

    Hello,
    I am using a Woodstock Basic Table from the NB palette.
    One of the columns is editable and I need to get the updated values upon a button click event.
    How do I get the value of a specific cell from the table?
    Thanks

    Hi Rajashekar ,
    here is the code :
    // Get a handle to the table footer bean
    OATableBean tableBean = ...;
    OATableFooterBean tableFooterBean = tableBean.getFooter();
    if (tableFooterBean != null)
    // Get a handle to the total row bean
    OATotalRowBean totalRowBean = tableFooterBean.getTotal();
    --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Stored procedure to insert into multiple tables in sql server 2012, using id col from one table to insert into the other 2

    Hi all,
    Apologies if any of the following sounds at all silly but I am fairly new to this so here goes...
    I have 3 tables that require data insertion at the same time. The first table is the customers table, I then want to take the automatically generated custid from that table and inser it into 2 other tables along with some other data
    Here's what I have so far which does not work:
    CREATE PROCEDURE CustomerDetails.bnc_insNewRegistration @CustId int,
    @CompanyName varchar(100),
    @FirstName varchar(50),
    @LastName varchar(50),
    @Email nvarchar(254),
    @HouseStreet varchar(100),
    @Town smallint,
    @County tinyint,
    @Postcode char(8),
    @Password nvarchar(20)
    AS
    BEGIN
    begin tran
    insert into CustomerDetails.Customers
    (CompanyName, FirstName, LastName, EmailAddress)
    Values (@CompanyName, @FirstName, @LastName, @Email)
    set @CustId = (select CustId from inserted)
    insert into CustomerDetails.Address
    (CustomerId, HouseNoAndStreet, Town, County, PostCode)
    values (@CustId, @HouseStreet, @Town, @County, @Postcode)
    insert into CustomerDetails.MembershipDetails
    (CustomerId, UserName, Password)
    values (@CustId, @Email, @Password)
    commit tran
    END
    GO
    If anyone could help with this I would very much appreciate it as I am currently building an online store, if there's no registration there's no customers.
    So to whom ever is able to help, I thank you whole heartedly :)

    I hope by now it is apparent that statements like "doesn't work" are not particularly helpful. The prior posts have already identified your first problem.  But there are others.  First, you have declared @CustID as an argument for your
    procedure - but it is obvious that you do not expect a useful value to be supplied when the procedure is executed.  Perhaps it should be declared as an output argument so that the caller of the procedure can know the PK value of the newly inserted customer
    - otherwise, replace it with a local variable since it serves no purpose as an input argument.
    Next, you are storing email twice.  Duplication of data contradicts relational theory and will only cause future problems. 
    Next, I get the sense that your "customer" can be a person or a company.  You may find that using the same table for both is not the best approach.  I hope you have constraints to prevent a company from having a first and last name (and
    vice versa).
    Next, your error checking is inadequate.  We can only hope that you have the appropriate constraints to prevent duplicates.  You should expect failures to occur, from basic data errors (duplicates, null values, inconsistent values) to system issues
    (out of space).  I'll leave you with Erland's discussion for more detail:
    erland - error handling.
    Lastly, you should reconsider the datatypes you are using for the various bits of information.  Presumably town and county are foreign keys to related tables, which is why they are numeric.  Be careful you don't paint yourself into a corner with
    such small datatypes.  One can also debate the wisdom of using a separate tables for Town and County (and perhaps the decision to limit yourself to a particular geographic area with a particular civic hierarchy). Password seems a little short to me. 
    And if you are going to use nvarchar for some strings, you might as well use it for everything - especially names.  Also, everyone should be security conscious by now - passwords should be encrypted at the very least.
    And one last comment - you really should allow 2 address lines. Yes, two separate ones and not just one much larger one.

  • How do you sort a table that contains links to cells in another table?

    This is something that I used to be able to do in Numbers but since 2 or 3 updates ago this doesn't seem to happen.
    The problem I have is that I have a table that includes cells that are a sum of a number of cells from another table. When I try and sort by a column all the info in the cells change because, I imagine, the commands linking to the cells in the other table are offsetting by however many rows a particular row has moved.
    This didn't used to happen; it used to hold on to the same data and links regardless of where the sort function moved a row to.
    Had a look through the help pages but can't find anything about it. Has anyone found a way around this?
    Thanks in advance.
    Matt

    Hi mmatt,
    There are several ways to create sort-safe formulas. Without knowing what you are doing in your table it is hard to give specific advice but in general INDEX(), OFFSET() and I think INDIRECT() are sort safe- ie they will ocntinue to point to the same cell wherever they are in your sort.
    If you want specific advice you would need to provide more info.
    quinn

  • (semi-)automatically updating cells/tables in pages from a numbers document

    Hi,
    I've been googling around for a bit, but can't find out if this is possible and if so, how to do it.
    What I want to do is create a document in numbers (all the data for the invoices I send), then go to a standardized pages invoice and with a (couple of) click(s) generate the data from the numbers document.
    E.g.; I've done a job for someone, whereby I worked *2 hours* for €50/h = €100. They also pay my travelling costs, say 100km at €0.30/km = €30.
    Total amount excl. taxes = €130
    Add 19% taxes €24,70
    Total amount €154,70
    All the bold items would have to be in my invoice. I usually have a table in my invoice, so ideally I would crosslink cells from the the pages doc with the corresponding cells in the numbers doc and be able to update any changes I make from the numbers to the pages document with the click of a button.
    Is this possible within iWork '09?
    If so; how? If not; would it be possible with an external program?
    I'm now using MS Office, and my girlfriend knows how to do this between Word and Excel, but I don't want to always have to bother her for every invoice (it's not very easy, and I keep forgetting how to do it (and yes, I can write it down and look it up, but surely it should not be so hard to do someting like that on a Mac?)).
    Help is appreciated

    We may easily auto-fill a cell from the content of a cell of an other table.
    Assuming that we have sheet "Sheet 1" containing a table "Table 1"
    and
    a sheet "Sheet 2" containing a table "Table 1"
    In cell D5 of Table 1 of Sheet 2, insert the formula :
    ="Sheet 1 :: Table 1 :: B12"
    When you will insert something in cell B12 of Table 1 of Sheet 1,
    the value will be automatically available in cell D5 of Table 1 of Sheet 2.
    Yvan KOENIG (VALLAURIS, France) lundi 5 avril 2010 11:26:26

  • Automatically fill in field based on data from table rows

    hello,
    Users in our organization currently have to complete a number of different forms when an accident occurs. I am creating a .pdf that combines these fomrs into one, with the first portion being a data input section where the user inputs the data and then this populates other sections (pages of the form) that can later be saved and printed.
    The data input section contains subforms with tables. The tables have a row that has "add new item" and "delete this item" buttons.  The rows have dropdown list fields.
    I would like to create a field that will be automatically filled in with the values from the dropdown lists, including the values from the new rows that are added using the 'add new item' button.
    Any assistance in this regard would be most appreciated.  This is my first time on a forum, so I apologize if I have not been clear.
    Thank you.

    This is pretty complicated. You'll have to use scripting for this and I'll tell you how I'd approach this with JavaScript.
    First of all you need to decide at what point you want to populate this field with the drop down selections. I think you have two options.
    Option 1 - Automatically calculate this field each time a user makes a drop-down selection. It's possible that a user will enter data and then change a drop down value so you'll have to account for this.
    Option 2 - Create an update button that users click to calculate this field. There is still a risk that users will change the value in the drop down after clicking update, so you would want to use scripting to lock those fields (e.g. make them protected) when the update button is clicked. You could then change the caption of this same button or have a second button that when clicked would unlock those drop down fields.
    The other thing you need to do is figure out how to calculate this field. It seems to me you would probably build a string together that mixes text with the drop-down values. So your JavaScript would look something like this:
    calculatedField.rawValue = "The accident occurred on " + table.row1.date.rawValue + ". It was witnessed by " + table.row1.witness1.rawValue +
                                                      " and " + table.row1.witness2.rawValue + ".";
    When you're in the LC Designer JavaScript editor, hold control for the relative path to those fields and control + shift for the absolute path and then click on the fields whose values you want to access.
    I hope this points you in the right direction!

Maybe you are looking for