Tap Forms app icon half
Tap Forms Forum text image
Blue gradient background

Exchange tips and ideas with the Tap Forms community

Search Results for 'script'

Viewing 15 results - 1,861 through 1,875 (of 2,989 total)
  • Author
    Search Results
  • #40909
    pierrot_rennes
    Participant

    Test but error script at line 13

    Attachments:
    You must be logged in to view attached files.
    #40905

    In reply to: Watched TV Shows

    pierrot_rennes
    Participant

    Hi,
    Yeah !!! ? It works
    Just to understand … Did you have an error in the script?
    Another question :
    Do you have an explanation for the fact that not all episodes are integrated?
    For example, Band of Brothers (still ;-) but with others series too, there are missing episodes
    See screenshots
    Thank you very much for the correction

    Attachments:
    You must be logged in to view attached files.
    #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.

    #40895
    Sam Moffatt
    Participant

    You can use a script field to watch another field and set the record colour. Using the TV Shows template, here’s a script to watch a checkbox and set the field to green if checked or white if not:

    var completed = record.getFieldValue('fld-25c62d7db6004725910d926d8a7fd085');
    if (completed)
    {
    	record.setRecordColor('#00FF00');
    }
    else
    {
    	record.setRecordColor('#FFF');
    }

    Replace the hex colours with your own preferred colours and you can use a similar situation to check if it’s a given number and set the appropriate colouur.

    #40893

    In reply to: Watched TV Shows

    Sam Moffatt
    Participant

    Try replacing the script with the contents of this gist: https://gist.github.com/pasamio/3086e8209676e956459f6325b38ab95d. It should output some debugging messages once you submit the input, e.g.:

    11/6/20, 9:58:32 pm / TV Shows / Import from imdb
    ["/title/tt0185906/","tt0185906"]
    Requesting: https://www.omdbapi.com/?i=tt0185906&apikey=???&type=series&r=json
    series already exists Band of Brothers
    getting season number 1
    Requesting: https://www.omdbapi.com/?i=tt0185906&apikey=???&season=1
    Getting episode 2
    epsiode already exists: Day of Days
    Getting episode 3
    epsiode already exists: Carentan
    Getting episode 5
    epsiode already exists: Crossroads
    Getting episode 6
    epsiode already exists: Bastogne
    Getting episode 7
    epsiode already exists: The Breaking Point
    Getting episode 8
    epsiode already exists: The Last Patrol
    Getting episode 9
    epsiode already exists: Why We Fight
    Getting episode 10
    epsiode already exists: Points
    
    #40884

    In reply to: Watched TV Shows

    Sam Moffatt
    Participant

    If you open the script up in the script editor, the text box on the bottom right is the console log. Can you share the output of that corner with the input?

    #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.

    #40880
    pierrot_rennes
    Participant

    Hi,

    Is it possible to colorize the lines in multicolumn mode according to a check box?
    A script?
    I have a collection and I would like the row of a record to be colored if the check box is activated for each record
    Or even better depending on a value 1 or 2 or 3 in a field, the color would be different
    Unless there is another solution?

    Attachments:
    You must be logged in to view attached files.
    #40873

    In reply to: Watched TV Shows

    Sam Moffatt
    Participant

    Looks like you’re missing the trailing slash. When I go to IMDB, it adds the slash for me and the regexp for the script is looking for the final slash. Try https://www.imdb.com/title/tt0185906/ instead.

    #40868

    In reply to: Watched TV Shows

    pierrot_rennes
    Participant

    Hi,
    I imported the Watched TV Show form but it doesn’t work.
    Same problem as previous posts.
    When we launch the script, it inserts a new recording only marked NO (example: the Band of Brothers file – https://www.imdb.com/title/tt0185906).
    No information from the chosen TV show on IMDB
    In the script, I put my IMDb Api key in quotes otherwise there is an error in the script.
    When we launch the script, no file is inserted except a “No”
    See my screenshots in case I made a mistake.
    thank you in advance

    Attachments:
    You must be logged in to view attached files.
    #40863

    In reply to: Date form YYYY

    Sam Moffatt
    Participant

    Yeah, I think it was added to Tap Forms 5.3 earlier this year. Tap Forms 3.5.20 is the much older version that is still available for folks who haven’t upgraded yet.

    Tap Forms 5 added so many new features such as new CouchDB based replication (my favourite feature), support for scripting with Javascript and built in charting capabilities.

    #40853

    In reply to: Time Zone Fun

    Sam Moffatt
    Participant

    Try changing the Z to be +07:00 or similar. Tap Forms internally stores the dates in UTC+0 but will convert to your local time zone. Alternatively use a form script to change the time but probably best to do during import.

    #40795

    In reply to: Picklist in all forms

    Sam Moffatt
    Participant

    I don’t believe you could a single list, though if you put the states in a form you could export and re-import the form for each document. Each document is its own standalone document store without anything shared between documents. You could also potentially automate it with a script that pulled from a location and added/removed states.

    #40791

    In reply to: Picklist in all forms

    Chris Medeiros
    Participant

    Hey Wolfgang,

    Okay. You’ve tapped out my expertise on the topic of Pick Lists. I cannot give you a definite yes or no. I suspect it’s no, but maybe there’s a script that can be written to accomplish your goal. I don’t know. Hopefully, someone with more Tap Forms experience will be able to supply you with a better answer.

    I can think of a possible workaround. Do you have a form that contains a record for each Federal State? What if you export the records from your Federal States form, import it into your 2nd Document’s Form and then create a new Pick List in that Form using the “Use Values from field” option. Could that work?

    #40749
    Sam Moffatt
    Participant

    You could use a form script to create a pivot form and generate the data yourself. The API should have enough power to create a new form based on your current form and you’d just add fields yourself to an existing set of records.

Viewing 15 results - 1,861 through 1,875 (of 2,989 total)