Picklist Delete Values?

Viewing 1 reply thread
  • Author
    Posts
  • November 27, 2025 at 9:21 AM #53316

    Shane
    Participant

    Hey all, sorry to post so much but I’ve been spending a lot of time trying to explore the power of the Javascript API and I keep running into roadblocks while trying to create features for my project manager in Tapforms Pro. I just want to check my understanding of some of the JS functions.

    I know you can add values to a pick list by using the addValue method on a pick list object. I discovered that this will permanently add values to the pick list. I thought it would be cool idea to be able to dynamically create a pick list for a text field based on what’s happening in the form, but the addValue method is permanent. It would be cool to have a deleteValue which would allow for dynamically generated pick lists for a form/ document.

    Thanks.

    November 27, 2025 at 10:14 AM #53317

    Daniel Leu
    Participant

    ‘deleteValue()’ exists, but it’s not documented. I noticed in the past, that sometimes, changing the picklist on the fly doesn’t properly update until reopening the document. But this might have been fixed in the meantime.

    See here for some more hidden API features: https://lab.danielleu.com/tapformspro/tips-tricks/index.html?p=Tap-Forms-Pro—The-Unofficial-API#section-picklists

    Cheers, Daniel

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

    November 27, 2025 at 2:32 PM #53322

    Shane
    Participant

    I did logically try that even before seeing it on your website and it didn’t do anything. However like you say, sometimes things are finicky as to when TFP updates so I’ll have another go at it.

    Also undocumented is how to spit out values of a sorted pick list array. It was intuitive and I figured it out, but in case anyone’s searching for it:

    var sortedList = pickList.sortedValues;
        for (var index = 0, count = sortedList.length; index < count; index++){
    		console.log(sortedList[index].value);
    	}
        document.saveAllChanges();
    }

    Adding a “.value” at the end of the indexed array will spit out the pick list value in typical javascript fashion.

Viewing 1 reply thread

You must be logged in to reply to this topic.