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,846 through 1,860 (of 2,989 total)
  • Author
    Search Results
  • #41053
    Rocky Machado
    Participant

    Hi – In the Import Records Dialog, when I select a file and the field names appear in the Assign field types section. I notice that I can edit the Field Name. What is the intention? I was hoping I could define a mapping to a form. For Example, a field called description in the file. I might want to map it to a field type called comments in an existing form.

    thanks,
    rocky

    #40977

    In reply to: Driving Me Nuts

    Sam Moffatt
    Participant

    I certainly saw a bunch of weird issues with TF5 and Nearby sync but the performance was much better than iCloud and I didn’t want to pay IBM. Most of them went away when I did a star topology with my iMac but every so often I made a triangle which fixed some sync issues. I shifted to CouchDB support when it was added and since then I haven’t run into many more weird issues. I have had one instance where bringing an old device online caused a script field to be overwritten (I think Brendan improved the sync code to fix this at some point too) but that’s the only issue I’ve noticed. In at least the last year that I can recall I haven’t had an issue.

    I certainly recommend getting CouchDB setup, I ran mine on an old iMac 2011 for the longest time before finally moving it to a dedicated Linux box I bought a couple of years back.

    However because there can be issues, this is also why I have multiple backup solutions for Tap Forms on my GitHub. I do this on top of routine backups of the Tap Forms document on my Mac as well. It doesn’t matter what scale you’re at, having backups should be a part of your technology solution. Sync is not a backup solution and I’m yet to meet a perfect solution when you have a split brain. Tap Forms does a reasonable job in my opinion and I’ve not had too many issues.

    The central CouchDB server (or Cloudant if you wanted) provides a bidirectional sync from a central spoke. This means your device proactively reaches out to to the server to push changes that are made locally and when the server receives updates it proactively pushes the change to your device (if Tap Forms is open) otherwise you pull them down next time you connect to the server. The Nearby sync is only ever on a pull model which can make it hard to force consistent state across all devices as replication state is at the document level. Because it’s a pull model as well also means that there isn’t anything that proactively gets the changes off your device, it’s up to the puller to pull down the changes.

    tl;dr dedicated CouchDB is great for reliability, you can install it on your Mac and get it working on your home network

    #40953
    Sam Moffatt
    Participant

    Yeah, use a single script with all of the logic in it, you can pull in as many fields as you like and they’ll all trigger the script. You can then pass it through which ever conditionals you want in the Javascript code to set the row colour.

    I would advise against having multiple script fields for setting the row colour because then the logic for the row colour is in two places and debugging that is a nightmare to fix :)

    #40950
    pierrot_rennes
    Participant

    Hi Sam,

    It’s done, thanks a lot !!!
    If I want to color certain lines in relation to two fields to check, I can put everything in the same script I think?
    (with different colors of course ;-))

    #40946
    Daniel Leu
    Participant

    If you want to have checkboxes, following script sets a checkbox based on the ‘yes/no’ field:

    function Yes_No_Script() {
    
    	const check_mark_id = 'fld-xxx';
    	const yes_no_id = 'fld-xxx';
    
    	if (record.getFieldValue(yes_no_id) == 'Yes'){
    		record.setFieldValue(check_mark_id, 1);
    	} else {
    		record.setFieldValue(check_mark_id, 0);
    	}
    	form.saveAllChanges();
    }
    
    Yes_No_Script();

    This is a field script. If you change the checkbox value, it is overwritten by this script. That’s something that could be changed, but I wanted to keep it simple to start with.

    The only thing you need to change are the two ids.

    Cheers, Daniel

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

    #40944
    Kimberley Hoffman
    Participant

    I am trying to avoid replacements, so I don’t accidently erase data. Some of the fields are GDPR fields and they need to be kept. And truthfully, I have no idea on how to write a script.

    But maybe just changing the fields to text fields would be the easiest?

    #40942

    In reply to: Watched TV Shows

    Daniel Leu
    Participant

    I would copy the https://www.omdbapi.com/?i=tt0185906&apikey=???&type=series&r=json string into your browser and see if there is an episode 1. If there is, then there is an issue with the script, if there isn’t, then it is coming from ombpapi.com.

    Cheers, Daniel

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

    #40941
    Daniel Leu
    Participant

    I see two different options:

    1. replace ‘yes’ and ‘no’ with ‘1’ and ‘0’ in your csv and then import these fields as checkbox fields.
    2. import ‘yes’/’no’ fields as text field and then use a script field to translate it into ‘1’/’0′ of a checkbox field

    I don’t use imports often, so there might be another option.

    Cheers, Daniel

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

    #40939
    Azimut
    Participant

    Hello.
    The answer to my question has probably already been given elsewhere but I have not found anything so here it is: I don’t know anything about javascript (that’s important to say).

    I want to create TF forms that would be connected to form fields of pdf files that I have previously created. The goal is to master from TF all my documents to send to my contacts (CRM).

    Do you have a solution that is not too complex? Thank you for your help.

    #40938
    Sam Moffatt
    Participant

    I think you’ve created a form script rather than a script field. Form scripts are created on the “Scripts” tab but “Field Scripts” are created like normal fields with the type “Script”. Script fields should monitor the state of the fields they reference and auto update when those fields change. Just copy the working form script and put it into a new script field.

    #40936
    pierrot_rennes
    Participant

    Hi,
    Thank you both very much for your help, it works
    It is not automatic when I check the collection box, I have to trigger the script on each recording
    (see in join)
    Is there a possibility to make this automatic?
    good week-end

    Attachments:
    You must be logged in to view attached files.
    #40933
    Sam Moffatt
    Participant

    Good catch on the form.saveAllChanges(), should have put that in my original script. Seemed to work ok without it in the small testing I did though.

    #40932

    In reply to: Watched TV Shows

    Sam Moffatt
    Participant

    No idea if there was an error in the script, I might have fixed something but it wasn’t mine to begin with and to be honest I don’t actually generally use this template.

    I don’t know why there are gaps, I noticed that earlier but I wonder if that is because it’s not actually IMDB but an open version.

    #40931
    Daniel Leu
    Participant

    Well, it fixes your syntax error, doesn’t it? Sorry, I was only commenting on that and not checking your code!

    You should add a form.saveAllChanges() at the end of the function to save the color changes.

    Following script works for me:

    function Script() {
    	var check_mark = record.getFieldValue('fld-906aa8b165cf42c0830fd79a460afe75');
    	if (check_mark) {
    		record.setRecordColor('#f00');
    	} else {
    		record.setRecordColor('#000');	
    	}
    	form.saveAllChanges();
    }
    
    Script();

    Cheers, Daniel

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

    #40924
    pierrot_rennes
    Participant

    Hi,
    Thanks for your help
    I made the wrong field in my initial request
    I want the line to change color when the check box in the Collection field is activated
    I tried to understand and adapt your code with the corresponding field but I have a script execution error (see in join)
    If you can help me
    Good night

    Attachments:
    You must be logged in to view attached files.
Viewing 15 results - 1,846 through 1,860 (of 2,989 total)