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,336 through 1,350 (of 2,989 total)
  • Author
    Search Results
  • #44335
    DrJJWMac
    Participant

    I am creating a database with text fields. I want to export the data records as the equivalent to raw, ASCII text. I do not want the quotation marks around the text and I want the “\r” (carriage return) character to expand properly.

    How can I accomplish this?

    I am conversant enough in the JavaScript to use that method if needed.


    JJW

    #44332
    Theo Theodosiou
    Participant

    Thanks guys. Yes, I have tried setting the field option to hidden for these fields in customize form, and also in the view setting for the multi-column layout. In both cases the fields are hidden when I select the form itself, but when it is displayed as a linked form the fields show in the list.

    So as an example if I select the Albums form for say Classical, the fields are hidden in both the list view and multi-column display view, whichever I choose. However, when I select an artist and the form links the joined rows from the associated albums the columns in the album list are not hidden.

    It’s a shame because I actually have a third form in each classification called Tracks which is linked to Albums. So I can select an artist, then from the linked album list I can select a specific album and end with a track list. Sweet. It is just a shame that the albums and tracks show the hidden key fields which I used to link them.

    I should add that I realise that this last issue is off topic and not really a script issue but I guess this is an area when it would be nice to be able to have an associated script to allow dynamic tailoring of views but I realise this is a big ask.

    #44329
    Daniel Leu
    Participant

    Sorry, I don’t have a trick up my sleeve. The idea with a reference form might be the best workaround. I would write a script function to fetch the formID. This way, if @brendan adds something like form.catogory, you just can update that function and everything else in your code continuous to work. But here I’m just stating the obvious ;-)

    I have also noticed that hidden fields are still visible in the display when forms are referenced via a ‘Link to Form’ join. This is already messy as I currently have hidden key fields that clutter the display so I would like to keep these to a minimum.

    On the desktop you can select which fields are shown in the table by clicking on the icon at the top-left of the table. I’d assume that there is a similar setting on mobile.

    Cheers, Daniel

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

    #44327
    Theo Theodosiou
    Participant

    Thanks Daniel. Please excuse me if this reply appears more than once but my last attempt seems to have disappeared into the ether.

    I have indeed thought about a custom field but this would be at record level which would be overkill I think. Also I don’t believe it will help when creating records. I agree that a forms.category approach would be a good option.

    The whole story is that I am writing a script that calls a REST service I have written on a windows machine to ask for updates. (I no longer have my Macbook). When the script receives notification of a new record it will know to which Category and Form the record needs to be written. So I need a way of saying; get me the Id of form ‘Artists’ in category ‘Classical’. I think I will need to create a reference form in the Uncategorized section (which I am using to hold common code) and create a field for each of the Forms that I need to reference which can hold its internal unique Id. I will then use this to target the form when I add a record.

    I was hoping to avoid hardcoding these and just feel that being able to reference a form in an abstract manner would be more elegant.

    I have also noticed that hidden fields are still visible in the display when forms are referenced via a ‘Link to Form’ join. This is already messy as I currently have hidden key fields that clutter the display so I would like to keep these to a minimum.

    However, your comments are appreciated and confirm my understanding. I was hoping I had missed a trick.

    #44319

    In reply to: Weeks of work LOST

    Brendan
    Keymaster

    Hello Teo,

    Were you unlinking a record from an inverse relationship on a Link From Form field? If so, I recently fixed a bug that could cause more than just the selected linked record to be unlinked.

    I haven’t yet published the fix for this issue though. If you’d like to test a beta version with the fix, I’d be happy to set you up. Just email me at support@tapforms.com. The records should still be there, just not linked for that record anymore. I’m just guessing that this might be what happened based on your description.

    Sorry for this issue.

    Thanks,

    Brendan

    #44318
    Brendan
    Keymaster

    Tap Forms uses the system controls for checkmarks and script buttons. And macOS decides how those look. But it is possible to override that and draw these things myself at some point.

    #44312

    In reply to: Add to Calendar

    Jaime Moreno
    Participant

    This is the script:

    function AddCalendar() {
    var event_info = {“calendar_name” : “Reminders”,
    “title” : “Test 1”,
    “location” : “Location 1”,
    “notes” : “Notes 1”,
    “all_day” : true};
    var start_date = new Date();
    var end_date = new Date();
    end_date.setDate(end_date.getDate() + 1);
    console.log(start_date);
    console.log(end_date);
    console.log(event_info);

    var identifier = Utils.addToCalendar(event_info, start_date, end_date);
    console.log(identifier);
    }

    AddCalendar();

    And this is the console.log output:
    5/7/21, 4:15:15 PM / Test Calendar / TestScript
    Fri May 07 2021 16:15:15 GMT-0400 (EDT)
    Sat May 08 2021 16:15:15 GMT-0400 (EDT)
    [object Object]
    undefined

    Thanks!

    #44310
    Jaime Moreno
    Participant

    I found an old entry asking this question, but did not find an answer for it. The script button does not take the stroke color and fill color specified for it. Similar situation with Check Mark field. In contrast, Text and Number fields do. See attached figure.

    Can this be fixed sometime?

    Thanks.

    Attachments:
    You must be logged in to view attached files.
    #44309
    Daniel Leu
    Participant

    Reading the description for Categories, it looks to me that this is just a feature to better visualize forms and it is not a hierarchical component. Specially for your case, it would be helpful to have something like form.category to check which category the form belongs to. There is currently no API to support categories. Maybe something @brendan might in the future.

    Instead of using the formId, you might just use a custom field where you store the category. If it is just for a few forms, that’s not a lot of work and you can hide the field in order not the clutter the UI.

    Cheers, Daniel

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

    #44308

    In reply to: Add to Calendar

    Daniel Leu
    Participant

    Can you post your script?

    Cheers, Daniel

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

    #44307

    In reply to: Add to Calendar

    Jaime Moreno
    Participant

    I have followed the instructions for using Utils.addToCalendar, but something is not working.
    The console output for the line console.log(event_info) is “undefined”.

    I tried using a script field and a form script, with the same outcome.

    I am running MacOS 11.3.1 , in case it matters.

    Is this function still available? What may I be doing wrong?

    Thanks in advance for any pointers.

    #44288
    Theo Theodosiou
    Participant

    I have a requirement for which I plan to write a form level script. It is my first Tap Forms script although I have used Javascript extensively in the past.
    My project requires that the script process multiple records from different forms within a document.
    However, I have encountered a problem which I cannot see a simple solution to.

    To explain; I have created a document that contains three categories. Within each category I have created forms where the name is the same in each category. I then have a form which I have created to hold the script that I can run once to process content in each of the forms for each category.
    An example the Hierarchy would be:

    Document:–Music
    Category:—-Classical
    Form:———-Artists
    Form:———-Titles
    Category:—-Classical
    Form:———-Artists
    Form:———-Titles
    Category:—-Uncategorized
    Form:———-Common script container.

    I have written a simple ‘hello world’ form level script that I have placed in the ‘Common script container’. This script iterates over each form in the document and displays the form name with a list of its fields.

    My problem is that I can’t find a way of differentiating the category when I list off the form names. I realise that I could create my own Category field but it seems that there should be a way of retrieving the category for the form via a function call but I just can’t seem to find anything in the documentation I have seen. I guess I could hard code the form Id to reference existing forms but how can I create a form in a specific Category using the ‘create New Form Named’ function.

    Am I missing something?

    #44270
    Chris Ridd
    Participant

    Good point Sam, however I’m not using links, only the default form, and almost no scripts.

    #44269
    Sam Moffatt
    Participant

    If you’ve got a lot of links, each link is also a record for the purposes of sync (in addition to forms, fields, layouts, layout items, searches, scripts, categories, table rows and records being records for the purposes of sync). I have some documents that have more links than records in them :D

    #44265
    Brendan
    Keymaster

    It looks like NSImageEXIFData is only available on macOS.

    I actually already have code to fetch the EXIF data from an image at a URL:

    + (NSDictionary *)getExifDataFromImageUrl:(NSURL *)url {
    	
    	NSDictionary *exifData = nil;
    	
    	CGImageSourceRef mySourceRef = CGImageSourceCreateWithURL((__bridge CFURLRef)url, NULL);
    	if (mySourceRef != NULL) {
    		NSDictionary *myMetadata = (__bridge NSDictionary *)CGImageSourceCopyPropertiesAtIndex(mySourceRef,0,NULL);
    		exifData = [myMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary];
    	}
    	
    	return exifData;
    }

    Perhaps I could expose it to the scripting engine.

    I use this method to get the photo’s timestamp so when you export the photos, Tap Forms can set the file’s creation date to the photo’s original date/time value.

Viewing 15 results - 1,336 through 1,350 (of 2,989 total)