Keep field the same value from previous

Viewing 10 reply threads
  • Author
    Posts
  • April 7, 2021 at 1:49 PM #44069

    Rich Trice
    Participant

    Is there a way to keep the value of the same from the last entry that was created?

    Example, I have a field called seller and I would like to keep the value you from the previous field until I change it. I can have several items that I need to inventory and having to enter the seller over and over is time consuming over 100s of entries.

    Thanks

    April 7, 2021 at 2:01 PM #44070

    Daniel Leu
    Participant

    Did you look into using “duplicate record” (cmd-D) when entering a new product? This way the seller’s information would be retained and you only have to adjust the product section.

    April 7, 2021 at 3:12 PM #44072

    Rich Trice
    Participant

    Thanks for the idea Daniel, however that is still a lot of unneeded touching. Think of inventorying 100s of items a day and every extra second per item adds up over the day.

    April 7, 2021 at 4:32 PM #44073

    Daniel Leu
    Participant

    If you have to inventory so many things a day, it might be better to import the data using CSV files.

    Or you can use a simple script that creates a new record and propagates your customer fields from the current records, or duplicate a record and delete unwanted data.

    April 7, 2021 at 11:10 PM #44075

    Sam Moffatt
    Participant

    If it’s a single field, or set of related fields for something like seller, I’d consider having a seller form and using a link to form field to your inventory form. Then you open the linked inventory form from the seller and that linked field is retained for each new record you create.

    If you have multiple unique fields then I agree with Daniel that a simple script that creates a new records and copies the fields from the current record to the new one and then navigates to it would make sense.

    One other trick I use for bulk importing is to use the prompter interface to present the subset of fields that I need to edit and put that into a loop. That can give you a much faster data input system because you can enter the data, hit enter to submit and then have it popup again to input the next record. I use prompters to create records in a few places where I don’t need to see the record immediately after creation as generally the prompter flow is a little quicker than going into a record in a link to field use case.

    April 7, 2021 at 11:56 PM #44078

    Victor Warner
    Participant

    Sam,

    Would it be possible for you to make one of your videos to demonstrate how to use the prompter interface – as what you write in the last paragraph is something I would be very interested in doing if I could work out how to implement the relevant JavaScript.

    April 8, 2021 at 8:25 AM #44081

    Sam Moffatt
    Participant

    Sure, I had a prompter video in mind the other day for doing the simple use case and I can add this loop to the end of that.

    April 8, 2021 at 10:40 AM #44084

    Victor Warner
    Participant

    Sam,

    That would be great…

    April 9, 2021 at 1:04 PM #44096

    T.L. Ford
    Participant

    I did this using a Field of Type Script on my table and then updating the Default Values for fields, which acted equivalent to a MS Access AfterUpdate event.

    function Change_Default_Values() {
    
    	var author_id = 'fld-d3d7e4d8d3104c70a002ba5016f597c1';
    	var year_id = 'fld-a6fa7f9e718640d0b52c6f3baa5a40db';
    
    	var author_fld = form.getFieldWithId(author_id);
    	var year_fld = form.getFieldWithId(year_id);
    
    	var author = record.getFieldValue(author_id);
    	var year = record.getFieldValue(year_id);
    		
    	if (!author) { author = ""; }
    
    	author_fld.defaultValue = author;
    	year_fld.defaultValue = year;
    	
    	document.saveAllChanges();
    
    }
    
    Change_Default_Values();
    April 9, 2021 at 9:36 PM #44106

    Sam Moffatt
    Participant

    Oh that’s an interesting approach, it essentially updates the default value each time you change any of those fields so that the next record you create uses that value.

    April 9, 2021 at 10:08 PM #44107

    Brendan
    Keymaster

    In my mileage tracker sample document, the user selects a record, then runs a script. It copies the old odometer reading from the selected record, then creates a new record and copies the value into the new record as the previous value. Then you can type in a new value and Tap Forms will compute the difference.

    So that’s another way to copy values from a previous record. The previous record is the one you’ve selected. The script creates a new record using data from that “previous record”.

    Mileage Tracker (Tap Forms 5.3)

Viewing 10 reply threads

You must be logged in to reply to this topic.