Pick lists w/ comment

Viewing 3 reply threads
  • Author
    Posts
  • March 15, 2026 at 2:33 PM #53670

    Glen Forister
    Participant

    I need a field that is a number that can be used in a graph against time.
    To fill that field I would like it to be a quick pick list. That is easy.

    The number represents certain conditions which I don’t always remember.
    The only way to do this is with a text box describing each number that shows up in the pick list.

    Is there a more elagent way to do this within the pick list instead of having those descriptions on the face of the form?

    March 15, 2026 at 3:29 PM #53674

    Daniel Leu
    Participant

    Hi Glen,

    You could use a picklist format like ‘1: Red’, ‘2: Blue’, ‘3: Green’ and then add a field script to extract the value before the column:

    function Picklist_Value() {
    
        const picklist_id = 'fld-xxx';
    
        const picklist = record.getFieldValue(picklist_id);
    
        // check that picklist has a value
        if (picklist) {
            // split picklist value and use first element
            const number = String(picklist).split(':')[0];
    
            // return number
            return Number(number);
        }
    }
    
    Picklist_Value();
    

    This script returns a ‘Number’ so you have to set the return type accordingly.

    Now you can create your graph using the return value of this script and don’t need to remember the values when using the picklist.

    Hope this helps!

    • This reply was modified 18 hours, 12 minutes ago by Daniel Leu.
    • This reply was modified 18 hours, 12 minutes ago by Daniel Leu.

    Cheers, Daniel

    ---
    See https://lab.danielleu.com/tapformspro/ for scripts and tips&tricks

    March 15, 2026 at 4:05 PM #53677

    Glen Forister
    Participant

    That sounds possible if I understand it. I’ll play with that.
    Thanks.

    March 15, 2026 at 6:10 PM #53685

    Brendan
    Keymaster

    I’ve just made a modification to Tap Forms Pro that will extract out the number values from a Pick List attached to a Number field. So you’d be able to setup a Pick List like this:

    10 Red
    20 Blue
    30 Green
    40 Yellow
    199.23 Unknown

    And when you select the value, just the numeric part will be assigned to the Number field.

    Attachments:
    You must be logged in to view attached files.
Viewing 3 reply threads

You must be logged in to reply to this topic.