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,536 through 2,550 (of 2,950 total)
  • Author
    Search Results
  • Victor Warner
    Participant

    I am finding that if I type a space after a quote (double or single) causes Tap Forms to hang.

    For example

    var result = ‘ ‘;

    after I type the first quote ‘ and then press the space bar, Tap Form hangs (spinning beachball). This happens every time.

    This happens on both Macs I use.

    macOS 10.14.4 – Tap Forms 5.3.5

    #34148
    A Ibanez
    Participant

    I created a Time field (not datetime) and I want to set its value with a script.

    I have tried the following:

    
    inRecord.setFieldValue(broadcast_jst_id, "01:05");
    
    
    inRecord.setFieldValue(broadcast_jst_id, new Date("01:05"));
    

    Unfortunately after the script runs the field is blank.

    #34147
    A Ibanez
    Participant

    In the meantime, I think I’m gonna create a script that just finds all unique genres and puts them somewhere else so I can easily copy and paste them into the genres pick list. I want to use Comboboxes, checkboxes, and others for the things I want to keep in pick lists.

    #34146
    Brendan
    Keymaster

    I haven’t opened up the PickList object to the JavaScript API yet.

    Instead of using a Pick List though you could perhaps enable the “Use Auto-Complete” function? That way Tap Forms will build a popup menu of values already from the values you’ve already got in the field in that form.

    #34144
    A Ibanez
    Participant

    The script I’m writing to populate my anime database automatically pulls the genres and sets them in a text field separated by tags (Fantasy,Magic,Drama,Comedy). I’d like to add those four tags to a Genres Pick List. I created the pick list already, but I can’t seem to find a way to add anything to them with a script.

    I checked the documentation and couldn’t find any reference to interacting with picklists from the JavaScript API.

    I’m aware I can open my pick list and click the “+” button to add all the contents to the pick list and it will automatically split the string based on a comma and add them in, but my database is gonna have 700 records and I don’t wanna go through each of them manually. There is also the possibility that new genres will be added over time.

    #34137
    Brendan
    Keymaster

    Hi Andy,

    It’s actually easier than this.

    If you create a Default Value for your Website Address field like this:

    https://myanimelist.net/anime/[Mal ID]

    Then Tap Forms will automatically inject the value of the Mail ID field into the URL when you click the little globe button next to the Website Address field.

    Hope that’s an acceptable solution.

    You can also of course use a Script field to do this too by having the Script field write a URL for you into your MAL URL field.

    Thanks!

    Brendan

    #34134
    A Ibanez
    Participant

    Heya. Sorry for the unclear title, I will explain below.

    I’ve been using TapForms for years but I just realized how powerful it is with Calculations and Scripts. So I’m working on migrating an anime database to a new format.

    Here’s my situation.

    – I want to keep a numerical field called “MAL ID” that stores the ID of a series in myanimelist.net.
    – I want to generate a URL called “MAL URL” whose format would be “CONCAT(“https://myanimelist.net/anime/”, [MAL ID]”, where “MAL ID” is the value of the MAL ID field. This would for example create this URL: “https://myanimelist.net/anime/31240”
    – I’d like to store the value of the “MAL URL” field in a field of type “Web Site” called “Web Site” so I can click on it when I’m on my phone to visit it easier.

    I can generate the URL based on the MAL ID field, but I cannot figure out a way to bring the value of the “MAL URL” website to make it clickable in the “Web Site” field.

    To simplify my explanation, have a look at this screenshot:

    The MAL ID field is the only field that the user edits manually. Tapforms then generates the link to MyAnimeList using a Calculation field in “MAL URL”. Now I want to bring the value of MAL URL into “Web Site” keeping the “Web Site” field type.

    Is there any way to do this?

    Attachments:
    You must be logged in to view attached files.
    #34107
    Brendan
    Keymaster

    Hi Kirk,

    Thanks for the added details. I’ll look into this further based on your description.

    However, at the moment with the latest macOS and Xcode versions, I’m having troubles compiling a third party library I use, so once I get that all resolved, then I’ll be able to dig into this issue. I may need to contact the third-party library developer to see if they can help. Unfortunately it’s the CouchbaseLite database engine I use which isn’t compiling anymore, so it’s a pretty important piece of code.

    Thanks,

    Brendan

    #34103

    In reply to: QR Code Question

    Brendan
    Keymaster

    Hi Eddzo,

    There’s no access controls like that in Tap Forms. So that part wouldn’t work.

    The only two places QR codes are used in Tap Forms is for searching for the value of the scanned QR code and for entering in the data of the scanned QR code.

    However, with a script, you could have Tap Forms take the value of a scanned barcode and do something with it such as call out to your server and do something there.

    If you look at the Scripting chapter, you’ll see an example of fetching from a movie library web service for the given barcode value. You can add a Field Script which will trigger the script when a barcode is scanned into a field.

    Thanks!

    Brendan

    #34102

    In reply to: Sorting by position

    Brendan
    Keymaster

    Hi Antonio,

    Yes, I do use CouchbaseLite for Tap Forms. And yes you’re right, they do have geo spatial queries. In fact, the Mac version uses that on the Map View to fetch records that are within a certain geographic area as defined by the zoom level of the map. But it still fetches the records according to the defined Sort Field settings, not by distance to some arbitrary coordinate.

    There’s no auto-run function for scripts outside of a Field script that gets run when you modify a field that the script references. You can setup a shortcut key to run a Form Script though. You would have to manually trigger that when you select the form. You can also add a Run Script button to a custom layout to run a script too.

    You might be able to write some JavaScript to call out to a web service to figure out the distance between two points and then update a distance field within Tap Forms and then sort by that. Either that or if there’s a distance algorithm in JavaScript you could use, such as the Levenshtein distance algorithm. But that only gives you the distance between two points ‘as the crow flies’.

    #34099

    In reply to: Sorting by position

    Antonio Calanducci
    Participant

    Hi Brendan,

    thank you for the reply.
    What type of database are you using behind the scene to store data locally? As I see you support CouchDB syncing, this let me think that you could use Couchbase mobile, that should support geospatial queries. But as you are mentioning indexes in your answer maybe it’s not the case (I read somewhere you used to use SQLite, but not sure if this applies to the macOS version too).

    I haven’t yet taken a look to the Javascript APIs: is there some hook to run a script at a given time? For example, if I can set a trigger on form loading, I could run a script that takes my current position, calculate the difference between my position and every fields’s position and populate a distance field, so I can sort the records by this field. Is this what you meant above as “separate distance function” ?

    I know this is not optimal, but at least I could solve my problem for the moment.
    thank you

    #34089
    Brendan
    Keymaster

    Hi Keith,

    Not with a Calculation field, but it can be done using a Script field because Script fields can write their results to other fields. So you could write a script to gather your values from your fields in the record, then perform the same kind of calculation you would have done in the Calculation field, and then just write the result into your Rating field.

    Thanks!

    Brendan

    #34072
    Brendan
    Keymaster

    Hi Kimberly,

    You can also do something like this with a Calculation field or a Script field. It’s up to you.

    But in a Calculation field, the formula would simply be:

    "#" + Keyword

    Set the formula to return Text.

    Then in your Calculation field you’ll get #Keyword as the result, where the value of Keyword is whatever is in the Keyword field.

    Give that a try and if you’d prefer a script, let me know.

    #34069
    Kimberley Hoffman
    Participant

    Hi Brendan and the rest of the community,

    Could someone suggest a simple script for creating a hashtag out of a blog keyword?

    I have a file that is connected to my social media file planner. The purpose of the script is to automatically write a hashtag from a keyword. Both will appear in the editorial theme file which I will then copy and paste into wherever they belong. The keyword would be copied into Yoast for my WordPress blog , the hashtag would be copied into Instagram,Twitter or Facebook.

    i.e. Keyword = Mannheim; The result of the script should be #Mannheim

    I realize I could just use copy and paste from the keyword line in the file into the hashtag line. But it would be timesaving to automate that. Unfortunately I don’t know how to write scripts.

    Would somebody help me, please? Thanks.
    Kimberley

    #34047
    Brendan
    Keymaster

    Hi Joe,

    You could do that with the use of a hidden Script field that references your Item # field. You would have to load in the records of the Products form, loop through them and look for the record that contains the Item # specified. Then copy the values from the found record into the child record you added. I should probably add a proper search API to the Script feature so you wouldn’t have to write the code to loop through the records yourself.

    Other than that you’d have to just click on the checkmark button to display the popover with the list of child records, then type in your Item # and select the matching one from the list.

    Thanks,

    Brendan

Viewing 15 results - 2,536 through 2,550 (of 2,950 total)