Enter a number to many records

Viewing 6 reply threads
  • Author
    Posts
  • June 11, 2020 at 8:11 AM #40882

    Wolfgang
    Participant

    Hello, I want to enter the same content to a field called “Number” in several records at once?

    June 11, 2020 at 9:23 AM #40883

    Sam Moffatt
    Participant

    How are you determining which records to enter the same content in? Is it based on a value they have (or don’t have)? Is it just selecting them? Is it based on when they were created or last modified?

    If you can figure out something in the record, you could script it. If you’re selecting a bunch of records, I’m not sure there is a way to change their values. If selecting records created a selection Javascript object, then you could script it but apart from that I’ll defer to Brendan.

    June 11, 2020 at 11:33 PM #40898

    Wolfgang
    Participant

    Hi Sam, there could be two options: copy a number (e.g. 12345) into the “Number” field for all records. Or create a selection of records (using Search) and then copy that number 12345 into the number field. Then later find another selection of records and insert a number 6789 in all number fields of these new found records… (I could also create saved search (May records, June records etc.) and then copy my special number to this number field). I also have a checkmark field in my records and could query this data field, if done or not.

    June 12, 2020 at 12:21 AM #40902

    Sam Moffatt
    Participant

    The Javascript API gives you the ability to iterate over all records in a form (form.getRecords()), you can use a search term (form.getRecordsForSearchTerm('term')) and you can also use a saved search (with the saved search selected, search.getRecords()).

    If you know what your criteria is and you can programmatically validate them then you can use a form script to update the values. I think I’d aim to have a saved search because you can review the target records and then use search.getRecords() to set the value.

    Something like this should work, you’d need to replace the field ID with your own:

    search.getRecords().forEach(rec => rec.setFieldValue('fld-changeme', 1337))
    

    If you put that into a form script (delete all of the boilerplate), update the ‘fld-changeme’ to match the field ID (if you double click on the left it should insert a place holder you can get it from) and then change 1337 to the number you want it to be then it should bulk fill the field for you. I’ve typed this a little off the cuff but it should work.

    With a little bit more work you could probably set it up with a prompter to prompt for the value but that should work to begin with.

    June 12, 2020 at 12:47 AM #40903

    Wolfgang
    Participant

    thank you very much.
    There is no way like this?:
    have all records or selected records and fill the “Number” field of one record with “12345” and then say: fill all (selected) records with this content?
    I think this could also be a good idea if a field of many records has a wrong content. And with one menu command I can change the content (wrong: Wolvgang and change it to Wolfgang…).

    June 12, 2020 at 7:37 AM #40921

    Daniel Leu
    Participant

    Did you try Multi-Column list view? If your records are adjacent, you can just fill all fields using the mouse. Select the field with with the data, then drag the yellow dot up or down to fill the field in the other records.

    June 12, 2020 at 10:31 AM #40923

    Wolfgang
    Participant

    Hi Daniel, that’s it…!! perfect ?. I knew that I once did it with a checkbox field – but not exactly how and with what software! thanks for the tip

Viewing 6 reply threads

You must be logged in to reply to this topic.