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 - 346 through 360 (of 2,989 total)
  • Author
    Search Results
  • #50962

    In reply to: Movie Library Template

    Brendan
    Keymaster

    It’s possible not all the data is provided from the API that the script is expecting. Did you put in your API ID values into the script?

    #50961
    JScottA
    Participant

    You are welcome, Daniel. I’m no expert on scripting Tap Base. I use it for doing a variety of data science stuff…nothing that requires scripting. I hope the custom GPT does provide some help. Sometime this week I’ll review the priming and see where I can improve it. If anyone hears of any updated manuals or additional Tap Form documents that I can add to the GPTs knowledge, let me know and I’ll see about processing it for including.

    I’m very interested in seeing where Tap Forms goes in possibly supporting Apple Intelligence. I think it might be very useful to professionals and small business to have access to a database that Apple Intelligence could access for its own knowledge. The most immediate impact, in my mind, is using Tap Forms like a local AirTable and combining it with Shortcuts/AppleScript to create powerful automation workflows.

    Until then, I’ll keep this GPT up and running. ;-)

     

    #50960
    Daniel Leu
    Participant

    Looking at the ChatGPT recommendations:

    – In the “Patients” form, create a corresponding table field that can hold the linked medications data. You can configure this table to fetch and display the medications from both “First visit” and “Follow-up visit” forms.

    No such feature for table fields exists.

    4. **Populate the Data:**
    – When you enter data in the “First visit” or “Follow-up visit” forms, you can use the link field to select the relevant patient from the “Patients” form.
    – Enter the medications prescribed in the table fields for each visit.

    To me, more natural would be to start with the “Patients” form and add a “First visit” or “Follow-up visit” record and then populate the respective fields.

    5. **View the Data in the Patients Form:**
    – In the “Patients” form, you will be able to see the linked records from both the “First visit” and “Follow-up visit” forms. The table fields will display all medications prescribed across different visits.

    Note that the table fields of the “First visit” or “Follow-up visit” are only visible when visiting the respective records and are not visible in the ‘linked records’ table.

    The proposed approach doesn’t provide a working solution, but at least it shows the basic setup.

    In the past, I already used ChatGPT to write scripts. By knowing what I need and having an idea how the script should look like, I was able to guide ChatGPT to a working answer. Maybe with this customized ChatGPT instance I can get better results faster. Got to try this!

    Thank you for setting the custom ChatGPT up, Scott!

    Cheers, Daniel

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

    #50955
    JScottA
    Participant

    Using the Tap Forms 5 Assistant (a custom GPT that is not officially supported or endorsed by Brendan) I got the following response by pasting in your post:

    To achieve the goal of having medications prescribed during either the first visit or a follow-up visit show in the “Patients” form, you can utilize the “Link to Form” field type in Tap Forms. Here are the steps to set this up:

    1. **Create the Link to Form Fields:**
    – In each of the forms “First visit” and “Follow-up visit,” add a new field of type “Link to Form” and link it to the “Patients” form. This creates a relationship where records in “First visit” and “Follow-up visit” can be associated with records in the “Patients” form.

    2. **Link Medications to the Patients Form:**
    – In the “First visit” and “Follow-up visit” forms, create a table field to store the medications prescribed. This table field can be populated with medication details for each visit.
    – In the “Patients” form, create a corresponding table field that can hold the linked medications data. You can configure this table to fetch and display the medications from both “First visit” and “Follow-up visit” forms.

    3. **Set Up the Relationships:**
    – When creating the “Link to Form” field, ensure that you enable the “Show Inverse Relationship” option. This will create a corresponding “Link from Form” field in the “Patients” form, enabling you to see which “First visit” or “Follow-up visit” records are associated with each patient.

    4. **Populate the Data:**
    – When you enter data in the “First visit” or “Follow-up visit” forms, you can use the link field to select the relevant patient from the “Patients” form.
    – Enter the medications prescribed in the table fields for each visit.

    5. **View the Data in the Patients Form:**
    – In the “Patients” form, you will be able to see the linked records from both the “First visit” and “Follow-up visit” forms. The table fields will display all medications prescribed across different visits.

    For more detailed instructions, you can refer to the section on creating and managing relationships between forms in the Tap Forms documentation, specifically pages 91-94, which cover the “Link to Form” and “Link from Form” fields and how to use them to create one-to-many and many-to-many relationships.

    By following these steps, you will be able to enter medications in the “First visit” and “Follow-up visit” forms and have them visible and modifiable in the “Patients” form, achieving the desired outcome.

    For additional details, you can also explore the scripting capabilities of Tap Forms if you need more advanced customization: [Tap Forms Scripting 101](https://www.cattail.nu/tap_forms/tap_forms_scripting_101/index.html).

    References:
    – Tap Forms Documentation, pages 91-94.

    Hopefully this is helpful.

    Cheers!

    Scott

    #50925

    In reply to: From Tap Forms to JSON

    Daniel Leu
    Participant

    Another option is to use the Javascript API to create a JSON record. You can use the clipboard to exchange data with another application. Writing to a file is not supported by the Javascript API. If you have an URL listener, than that would be an option too.

    I have a simple example script to copy a record to another Tap Forms document: https://lab.danielleu.com/blog/copying-record-data-between-documents/. This can be extended to copy all records instead of just one.

    Cheers, Daniel

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

    #50903
    Daniel Leu
    Participant

    You could use Utils.postContentToUrlWithContentType() or Utils.postJsonToUrl() to post content to your server. Both API functions are documented in https://www.tapforms.com/help-mac/5.3/en/topic/javascript-api.

    Cheers, Daniel

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

    #50901
    Brendan
    Keymaster

    Hi David,

    You could do this with a Script Field. Something like this:

    function Sortable_Title() {
    var title = record.getFieldValue('fld-3b1b39ccf20f43e583fe66b8aaa0602c');
    var sortableTitle;
    
    if (title.startsWith('A ')) {
    sortableTitle = title.substring(2);
    
    } else if (title.startsWith('An ')) {
    sortableTitle = title.substring(3);
    
    } else if (title.startsWith('The ')) {
    sortableTitle = title.substring(4);
    
    } else {
    sortableTitle = title;
    }
    
    // console.log(sortableTitle);
    
    return sortableTitle;
    
    }
    
    Sortable_Title();
    You could enhance it to support other article words if you like.
    Thanks,
    Brendan
    • This reply was modified 1 year, 6 months ago by Brendan.
    #50897
    Fabio Puissant
    Participant

    Hi, I am quite new to Tap Forms. I wanted to know, since using JavaScript is an option, if you are able to use fetch (or another JS API) to make an HTTP Request.

    I have a client using tap forms 5 and has some renewal_date column. I wanted to automate sending out emails on this renewal date. I wrote a script already to find records that are passed the renewal_date. Now, I have a webhook expecting some record data (email, client_No, renawal_date, …). I would like a way to make an HTTP request to my webhook providing the record data saved in tap form.

    Could anyone advice me please as I don’t find a way to do it. Is this even possible in TapForm??

    Many thanks!

    David Gilbert
    Participant

    There is at least one previous post about this topic, to get records not to sort by articles, where writing a script is suggested.
    I have a music title database with titles in many languages, so getting the sorting right is important. I’m thinking of setting up two fields, a display title and a sorting title. The records would sort by the sorting title:
    Étoile
    Jahsager
    Man in the High Castle

    But the form would only include the display title, and so the sort would appear like this.
    L’Étoile
    Der Jahsager
    The Man in the High Castle

    Not like this:
    Der Jahsager
    L’Étoile
    The Man in the High Castle

    It’s a lot of work to do this obviously, so I’m checking to make sure there is no other easy solution. Also, I guess this will work?
    Muchas gracias,
    David

    #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, 6 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.

Viewing 15 results - 346 through 360 (of 2,989 total)