Search Results for 'script'
Tap Forms Database Pro for Mac, iPhone, iPad and Apple Watch › Forums › Search › Search Results for 'script'
-
AuthorSearch Results
-
June 12, 2020 at 2:04 AM #40909
In 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.June 11, 2020 at 3:21 AM #40880Topic: Ability to color rows in multi-columns?
in forum Using Tap Forms 5pierrot_rennes
ParticipantHi,
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.June 10, 2020 at 6:13 PM #40873In reply to: Watched TV Shows
Sam Moffatt
ParticipantLooks 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.June 10, 2020 at 7:57 AM #40868In reply to: Watched TV Shows
pierrot_rennes
ParticipantHi,
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 advanceAttachments:
You must be logged in to view attached files.June 9, 2020 at 10:36 PM #40863In reply to: Date form YYYY
Sam Moffatt
ParticipantYeah, 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.
June 8, 2020 at 7:46 PM #40853In reply to: Time Zone Fun
Sam Moffatt
ParticipantTry 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.
June 3, 2020 at 11:31 PM #40795In reply to: Picklist in all forms
Sam Moffatt
ParticipantI 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.
June 3, 2020 at 5:08 PM #40791In reply to: Picklist in all forms
Chris Medeiros
ParticipantHey 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?
May 31, 2020 at 8:01 PM #40749In reply to: Question about Pivot data design
Sam Moffatt
ParticipantYou 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.
-
AuthorSearch Results