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 - 2,491 through 2,505 (of 2,864 total)
  • Author
    Search Results
  • #33628

    In reply to: Script: object TFField

    Thanks.
    Can you add a property field_id?

    For make indipendent scripts From Forms, and indipendent by database, i need a function like this:

    Form.getfieldid(‘name Of field’);
    And return the field_id ‘fld…’ without open snippets.

    Gianantonio

    #33618
    Brendan
    Keymaster

    There’s no scripting support for adding to the Calendar.

    The very first field in your form is what’s used to generate the default Title value. You can edit the title value of course before clicking the Add to Calendar button. The link to the record is also added to the calendar.

    #33617

    In reply to: Script: object TFField

    Brendan
    Keymaster

    Hi Gianantonio,

    Right now the only things exposed are the name, fieldType, and fieldDescription properties.

    I updated the JavaScript API to document the new APIs I added:

    https://www.tapforms.com/help-mac/5.3/en/topic/javascript-api

    #33612

    In reply to: Custom layouts in iOS

    Graeme Sheppard
    Participant

    I just wanted to register another request for custom layouts in iOS.
    I’m getting by for my use case by creating scripts to summarise information, which is a fantastic ability, but it’s a bit fiddly and not for everyone.

    I do love the scripting, though.

    #33608
    Pyromixer
    Participant

    How can I automatically enter my desired fields in the calendar?

    And can an appointment also be automatically entered in the calendar?

    Can I use a script for this? If so which code? Does anyone have any idea?

    #33607

    Please can you tell me the tffield’s struct?

    Thanks
    Gianantonio

    #33575
    Brendan
    Keymaster

    Hi Victor,

    The next update will support letting you reference another Script field within a script.

    Thanks,

    Brendan

    #33574
    Victor Warner
    Participant

    Brendan,

    In this post you showed how it is possible to use fields from a related Form.

    I am adapting the JavaScript code in other fields.

    But when I am in Edit Script, the list of fields of all Forms do not show any fields which are Script fields – so I cannot access them to declare their IDs.

    Is there a way to do so?

    #33533
    Brendan
    Keymaster

    I think I’m going to have to rethink how that deviceName property works. As you edit the records, the device name is stored on the record that edited it. But the script field also needs to be updated to show the deviceName value. And that causes a save to the database, which of course updates the database. I think I’m going to have to perhaps add something to the Script field that prevents it from updating the database, but to merely display the results. So maybe for now this is not going to work for you. Especially since if anyone else were to cause a Calculation field or a Script field to refresh across all records, they would effectively be updating every record, causing the deviceName property to be changed to their name.

    Tap Forms was never designed to be a multi-user database system and this was just a bit of a hack to see if I could display the name of the device that last made an edit to the record. It clearly needs some more thought and work.

    Sorry for getting your hopes up that this would be a viable solution.

    #33529
    Brendan
    Keymaster

    Hi Stephen,

    Yes, that’s right. Or you can just use this script:

    function Device() {
    	return record.deviceName;
    }
    
    Device();

    Try clicking the Refresh button at the bottom of the records list. You should see the value appear.

    Thanks,

    Brendan

    #33526
    Stephen
    Participant

    Hi Brendan,

    Thanks for the response. Do I simply create a ‘script’ type field and enter the text as you’ve written?
    I have attempted exactly that with the result set as text and I do not see anything in the form.

    Have I skipped an obvious step?

    Many thanks, Stephen.

    #33524
    Brendan
    Keymaster

    Hi Stephen,

    If you add a Script field that returns record.deviceName;, that will display the name of the device that created the record.

    #33503

    In reply to: Grab data from url?

    Brendan
    Keymaster

    Hi Steve,

    You can access a Location field value from a Script field. The location field value will end up being a dictionary that you can reference like this:

    var location_field_id = 'fld....';
    var location_value = record.getFieldValue(location_field_id);
    var title = location_value['title'];
    var latitude = location_value['lat'];
    var longitude = location_value['lon'];
    
    // now you can do whatever you want with the values
    

    The script can only get the values from a Tap Forms field. It doesn’t have a way to get the geo location coordinates itself. So you just need to add a Location field to your form and then let Tap Forms get the location for you for that field. Or of course you can set it to whatever location you want. Now once you have the location value, then the script can get access to the data.

    Your friend will need Tap Forms because there are specific Tap Forms functions that he’ll need access to.

    #33500

    In reply to: Grab data from url?

    Steve Smith
    Participant

    Question: how does the ‘script field ‘ know the gps coordinates of the phone? I have a Location field in the form already, can the script field use that? Or can the script grab the gps coordinates itself from the phones gps?

    Also, I cannot write code, a friend will be writing this script for me. I will send him the script page link you posted above, and he has already looked at the NOAA api documents. He does not have TF, will that be an issue?

    #33494
    Brendan
    Keymaster

    Hello Giantonio,

    Yes. On a custom layout you can do that.

    Display the Layout inspector panel on the right.

    Then click on the “Button” button at the top-right of that screen.

    Then drag out a button. Give it a name and select on the inspector panel which Form script you’d like Tap Forms to execute when you click the button.

    You can also assign shortcut keys to Form Scripts to execute them quickly too.

    Thanks!

    Brendan

Viewing 15 results - 2,491 through 2,505 (of 2,864 total)