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 - 316 through 330 (of 2,950 total)
  • Author
    Search Results
  • #50890
    Fabrice
    Participant

    Hey again Brendan,

    I just finished creating that second form. I followed the manual for the linking (I have to say, it’s so difficult for me to do simple things. I was searching everywhere how I should make the primary key, where it’s done automatically. So fantastic job in making things so easy).

    Once done, I followed your post and everything works now as intended (Yay ! I’m so excited it does work, now I finally have a solution to not only deal with my extensive list of video games (18 000+), but I can also finally evaluate the real cost of a game with all its DLC listed.

    That’s fantastic and no regrets in my choice to go for Tap Forms ! Thank you so much !

    Edit : I would like to give back to you as a thank you a small change your could bring to the application. Don’t worry, I’m sure it’s very easy to do, just a field to edit at best I think. There is an annoying (to me it is annoying) translation in the field description for the French language. I guess it would be “Important Date” in the English version, but in French it’s been translated as “The important date”. That’s confusing to me for a field description. So the suggestion would be to change “La date importante” into “Date importante”

    • This reply was modified 1 year, 4 months ago by Fabrice.
    #50886

    In reply to: Numerical order

    Brendan
    Keymaster

    Hi Bryan,

    You’d have to add the Number field and then fill in the numbers sequentially. However, if you have the Mac version, you could easily copy and paste a sequence of numbers by using Excel or Numbers to easily generate the number sequence down one column. Then copy the sequence of numbers and then in Tap Forms, switch to the multi-column list view, click the first record in that Number field and then paste. Tap Forms will copy the values from the clipboard to all of the records.

    If you’re interested in scripting, then you could also write a Form Script that loops through all your records and sets the sequence value that way.

     

    #50859

    In reply to: Tap Forms for RAG

    JScottA
    Participant

    I think that is a tech problem that has been solved in most places, else tools like Make.com couldn’t access resources like AirTable. Even Zapier accesses another large dynamic database for a CRM (Daylite). However, it might be a problem for Shortcuts because Apple may not provide the methods for you to specify which database/fields an Action wants to access.

    For an intermediary step, what can you access/control using AppleScript? I see that you do have some access to Tap Forms through AppleScript, but not enough to really use it for automation or RAG.

    Here is a real world use case: Content Management for News Journal

    Say I am an editor/journalist for a tech magazine. One of my less interesting but expected jobs is to post news about various company press releases. Typically, this is a time consumer without really being “journalistic”. So I want to use Shortcuts daily to poll all of the vendors I track (e.g. Apple, Belkin, Microsoft, Logitech, OpenAI, etc. there could be hundreds here). It will pull the news stories posted in the past 24 hours and store all of the information for each press release into Tap Forms (normally I use AirTable to do this currently). It then passes certain information from Tap Forms to ChatGPT to process (Title suggestions, keyword suggestions, summary suggestions per platform I publish to, suggested images for the my posts, etc). It presents the articles to me review along with the suggestions for me to edit/approve for publishing. The Shortcut then sends the edits and status of the article (e.g. published, postponed, not published, etc.) to Tap Forms.

    This approach keeps everything on my local machine, justifies my buying and keeping up-to-date Tap Forms because I can eliminate one or more cloud subscriptions, and I have greater control, privacy, and security for my data. And this is just one use case. But we need Tap Forms to powerfully support AppleScript/Shortcuts.

    #50854
    Neil Barnett
    Participant

    Hope you find the attached useful. I used to use an app on my phone and Mac but the subscriptions costs increased by 100% and so I thought I would have a go myself. Hopefully you may find it useful as well.

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

    I run into this the other day as well. The solution was just to add a dummy field id definition: const field_id = 'fld-xxx';. This was all TapForms 5 needed to detect the field dependency and trigger the execution of my field script.

    Maybe the API could be enhanced to add a trigger parameter to the field script object that the user can set if needed.

    Cheers, Daniel

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

    #50845
    Brendan
    Keymaster

    Everything you’ve described is correct and is exactly how Field scripts behave.

    You’ll need to be explicit about which fields you’re referencing in the getFieldValue('fld-...') function so that Tap Forms knows which fields to monitor. I’m sorry that it doesn’t work the way you want it to. But that’s another level of abstraction that Tap Forms doesn’t know how to deal with. And  there could be unintended consequences if I evaluate your JavaScript code just to find out what the Field IDs are when using getFieldNamed() so I can monitor those fields.

    #50840
    John Hamill
    Participant

    Thanks for the reply, Brendan.

    I believe your statement (that the getFieldNamed function is not disabled) is somewhat semantic. Maybe I am wrong, but my understanding of what you are saying is that the following process occurs in a field level script:

    Prerequisites for execution of a field level script:

    1. The function ‘getFieldValue’ MUST be present.
    2. A valid fld_ID value MUST be present. This value can be explicit or the value can be contained within a variable.

    Process:
    1. Tapform’s Objective-C code scans the source code in my script.
    2. It finds the function ‘getFieldValue’.
    3. It fails to find a valid fld_ID as the code (within the field level script) has yet to be executed as a Javascript.
    4. As the prerequisites have not been satisfied, no script execution actually takes place.

    What I am saying is that the ‘getFieldNamed’ function and its use within a field level script are basically incompatible as (at the Objective-C code scan stage), there will NEVER be a fld_ID to satisfy the second prerequisite stated above.

    That effectively makes useless any inclusion of ‘getFieldNamed’ in a field level script (for its primary function of retrieving a fld_ID). I agree that the function is not disabled, but it is inoperable (useless) within a field level script.

    That is my reading of it, but perhaps my understanding of the process above is wrong?

    #50834
    Brendan
    Keymaster

    The getFieldNamed() function is not disabled. It just doesn’t cause the field script to be executed when you enter a value into that field in the record. If there was another field that’s referenced with the field ID directly, then that will trigger the script to run.

    The trigger is specifically on the getFieldValue() function.

    #50833
    John Hamill
    Participant

    So if I am understanding this correctly, that function (getFieldNamed) is effectively disabled within a field level script.

    The script text MUST (at the outset) contain the fld_ID of a field that will “change value”.

    So any function that returns the fld_ID will be ineffective in a field level script (unless the script already contains a fld_ID). Perhaps getFieldNamed is the only function that does that?

    I cannot think of a workaround as you are very much limited when using a field level script.

    Is this correct?

    Thanks for help.

    #50824
    Brendan
    Keymaster

    The issue is that my Objective-C code scans your source code to determine which fields you’re referencing in the script by looking for the text .getFieldValue('fld-.....'). Or when using a variable instead of ('fld-....'). But it doesn’t execute your code before your function is run to determine what the field ID is for getFieldNamed('Analysis_G2') so that it can trigger the script when that value in that field changes.

    It works as a Form script because you’re manually executing the script when you want. But a Field script relies on monitoring the fields in the form to see what’s changed and then it runs the script if the script has a reference to one of those fields with the hard coded field ID.

    After you save your script, check the Fields list to see if you see a checkmark next to any of the fields. If so, those are the fields Tap Forms will monitor for changes. If you don’t see any, the script won’t be triggered automatically.

    #50822
    Brendan
    Keymaster

    Ya, that would be easier to read and debug with a Script field. But can be done with a Calculation field:

    IF(FieldA = 1; DATEADD(FieldC;0;0;-2;0;0;0;0); IF(FieldA = 2 ~ FieldA = 3; DATEADD(FieldC;0;-1;0;0;0;0;0);  IF(FieldA > 3; DATEADD(FieldC;0;-2;0;0;0;0;0); "")))

    I haven’t tested this, so it might not work, but that’s the general idea. The ~ character means or

    #50819
    Mitz
    Participant

    Hello Brendan, i am having issues with IF Nesting Functions. I searched and found that it is much simpler/easier to use script. However, i do not know Script. I saw the tutorial and was having a hard time comprehending. Anyway, I hope you can help if the formula. I need Field B to show 3 results, depending on 4 conditions:

    if Field A is 1, result is 2 weeks before the date in field C
    if Field A is 2 or 3, result is 1 month before the date in Field C
    if Field A is more than 3, result is 2 months before the date in Field C
    if Field A is 0, Field B should be blank

    Thanks so much in advance! TapForms is GREAT!

    #50818
    John Hamill
    Participant
    A javascript runs correctly with a “hard coded” field_ID. It fails however if the field_ID is retrieved using the functions ‘form.getFieldNamed(‘field_name’)’ and ‘object.getId()’.
    Can anyone see why this might not work? I intend to use this function in ALL of my forms. Hence the need to source the field_ID from its ‘field name”.
    Thanks for any help.
    The code is quite straightforward (you can substitute any field id below to test it). If the user enters “XXYY” in the field, it should set that field to ‘null’:
    function Script() {
    // ***** OPERATES CORRECTLY *****:
    // the following two lines of code work correctly (when the field id
    // hardcoded).
    var analysis_g2_fld_id = ‘fld-37435e1d73024374b4700105e49993c9’;
    var analysis_g2_value = record.getFieldValue(‘fld-37435e1d73024374b4700105e49993c9’);
    // ***** FAILS *****:
    // the following three lines of code do NOT work
    // (ie. when the field ID is sourced via functions). If the three
    // lines of code below are executed in a “form level script”, it does
    // work. It is only when in a “field level script” that it fails.
    // analysis_g2_obj = form.getFieldNamed(‘Analysis_G2’);
    // var analysis_g2_fld_id = analysis_g2_obj.getId();
    // var analysis_g2_value = record.getFieldValue(analysis_g2_fld_id);
    if (analysis_g2_value == “XXYY”)
    record.setFieldValue(analysis_g2_fld_id, null);
            return 0;
    }
    Script();
    form.saveAllChanges();
    #50814
    Olivier Ragasol
    Participant

    царь means tsar, all the entries are in cyrillic script. (The definitions are mostly in roman.)

    Quite oddly, a simple search — or an advanced search restricted to Domaine — with Aliments et boissons (Food and drinks) doesn’t yield anything, a search with Aliments only either. Instead, boissons yields all the records related to food and drinks…

    #50791
    Brendan
    Keymaster

    Hi Stephen,

    Just setting the value in the field should trigger the record colour value to update. Can you post a sample form template with your script inside so I can see what’s going wrong?

    Even something simple like this works:

    function Change_Value() {
    var new_field_id = 'fld-eeda81519fa94abab133b9a2b4d7847b';
    record.setFieldValue(new_field_id, "Two");
    form.saveAllChanges();
    }
    Change_Value();

    Have you made sure that you’re calling form.saveAllChanges()?

    Attachments:
    You must be logged in to view attached files.
Viewing 15 results - 316 through 330 (of 2,950 total)