Search Results for 'script'
Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Search › Search Results for 'script'
-
AuthorSearch Results
-
June 13, 2020 at 9:06 AM #40941
In reply to: Import Yes/No answers for checkbox
Daniel Leu
ParticipantI see two different options:
- replace ‘yes’ and ‘no’ with ‘1’ and ‘0’ in your csv and then import these fields as checkbox fields.
- 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&tricksJune 13, 2020 at 3:33 AM #40939Topic: Form TF connected to a PDF form
in forum Using Tap Forms 5Azimut
ParticipantHello.
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.
June 13, 2020 at 12:51 AM #40938In reply to: Ability to color rows in multi-columns?
Sam Moffatt
ParticipantI 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.
June 13, 2020 at 12:39 AM #40936In reply to: Ability to color rows in multi-columns?
pierrot_rennes
ParticipantHi,
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-endAttachments:
You must be logged in to view attached files.June 12, 2020 at 10:22 PM #40933In reply to: Ability to color rows in multi-columns?
Sam Moffatt
ParticipantGood 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.June 12, 2020 at 5:37 PM #40932In reply to: Watched TV Shows
Sam Moffatt
ParticipantNo 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.
June 12, 2020 at 2:51 PM #40931In reply to: Ability to color rows in multi-columns?
Daniel Leu
ParticipantWell, 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&tricksJune 12, 2020 at 11:00 AM #40924In reply to: Ability to color rows in multi-columns?
pierrot_rennes
ParticipantHi,
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 nightAttachments:
You must be logged in to view attached files.June 12, 2020 at 2:04 AM #40909In reply to: Ability to color rows in multi-columns?
pierrot_rennes
ParticipantTest but error script at line 13
Attachments:
You must be logged in to view attached files.June 12, 2020 at 1:23 AM #40905In reply to: Watched TV Shows
pierrot_rennes
ParticipantHi,
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 correctionAttachments:
You must be logged in to view attached files.June 12, 2020 at 12:21 AM #40902In reply to: Enter a number to many records
Sam Moffatt
ParticipantThe 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
1337to 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 11, 2020 at 10:25 PM #40895In reply to: Ability to color rows in multi-columns?
Sam Moffatt
ParticipantYou 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.
June 11, 2020 at 10:01 PM #40893In reply to: Watched TV Shows
Sam Moffatt
ParticipantTry 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: PointsJune 11, 2020 at 9:27 AM #40884In reply to: Watched TV Shows
Sam Moffatt
ParticipantIf 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?
June 11, 2020 at 9:23 AM #40883In reply to: Enter a number to many records
Sam Moffatt
ParticipantHow 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
selectionJavascript object, then you could script it but apart from that I’ll defer to Brendan. -
AuthorSearch Results