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 - 76 through 90 (of 2,864 total)
  • Author
    Search Results
  • #51817
    JScottA
    Participant

    Take the following information carefully as it from the Tap Forms 5 Assistant (a custom GPT that is not supported by Brendan…he is the go to expert on everything). However I hope it helps and gives Brenda more time for finishing the next version of the database!

    The issue described in the forum post — trying to navigate from a child form (e.g. “Tasks”) to a parent form (e.g. “Projects” or “Clients”) using a script button — is understandable but currently not supported in the exact way desired due to Tap Forms’ internal handling of navigation and view rendering.

    Here’s the technical reasoning and current limitation:

    🔍 Explanation:

    When you use a URL like:

    var theURL = “tapformz://record/view/[db-id]/[form-id]/[record-id]”;
    Utils.openUrl(theURL);

    It can navigate to a record, but only within the same form where the script is executed. If used to target a record in a different form (like a parent form), Tap Forms will select the record in the background but not update the current view — exactly as the user described.

    This behavior is confirmed by Tap Forms’ current URL scheme and scripting limitations, which do not allow cross-form navigation with visible view switching.

    ❌ This doesn’t work:

    var theURL = “tapformz://form/view/[db-id]/[form-id]/”;
    Utils.openUrl(theURL);

    Even though the intention here is to just open the parent form’s record list, Tap Forms does not act on this kind of URL in a user-visible way.

    ✅ Workaround:

    Unfortunately, based on current documentation (including scripting APIs at Tap Forms Scripting 101), there is no direct, supported way to programmatically navigate from a child record to a parent record’s detail view via scripting.

    The only partial workaround is to instruct users to manually click on the linked parent record shown via the inverse relationship field in the layout.

    ✅ Suggestion for Better UX:
    • Include a Link From Form field in the child form layout (enabled via “Show Inverse Relationship”).
    • Style it clearly so the user understands it’s clickable to reach the parent.

    If Tap Forms updates their scripting API or URL schemes in the future to support this kind of navigation more explicitly, a script-based button may become viable. But for now, it’s a platform limitation.

    Let me know if you want help crafting a better layout workaround or submitting a feature request to the developer!

    👋 This GPT is built specifically to help with Tap Forms questions. You can find it here: Tap Forms 5 Assistant.

    #51812
    Hans
    Participant

    Wow, thank you so much for the prompt response. I’m very impressed with how quickly it went. Unfortunately, I’m currently traveling for work and won’t have time until the weekend. When I have completed the implementation of the script in Tap Forms, I will get back to you with the result. Thanks again.

    #51810
    Daniel Leu
    Participant

    That’s an interesting project….

    Following function should return the next track number you’re looking for. To keep the function generic, it returns an integer. You need to set the ids of the three different fields (date_id, track_number_id and track_id_id).

    function getNextTrackNumber(){
    	const date_id = 'fld-xxx';
    	const track_number_id = 'fld-xxx';
    	const track_id_id = 'fld-xxx';
    
    	// get date and month from current record
    	const date = new Date(record.getFieldValue(date_id));
    	const month = date.getMonth()+1;
    	const year = date.getFullYear();
    	
    	// filter records to match year/month of current record
    	let recs = form.getRecords();
    	
    	let trackNumbers = [0]; // initialize array 
    	recs.forEach((el) => {
    		const thisDate = new Date(el.getFieldValue(date_id));
    		const thisMonth = thisDate.getMonth()+1;
    		const thisYear = thisDate.getFullYear();
    	
    		if (month == thisMonth && year == thisYear){
    			let trackNumber = parseInt(el.getFieldValue(track_number_id));
    			if (!isNaN(trackNumber))
    				trackNumbers.push(trackNumber);
    		}
    	})
    	
    	console.log(JSON.stringify(trackNumbers, "",4))
    	
    	// get max value
    	const maxTrackNumber = Math.max(...trackNumbers);
    	const nextTrackNumber = maxTrackNumber + 1;
    	console.log("nextTrackNumber: " + nextTrackNumber);
    
    	return nextTrackNumber;
    }
    
    

    Attached is my test form. It contains two scripts, one to set the track number field and the other for the track id field.

    The track number is automatically set to “01” when no entry is available, otherwise to the next value. You can overwrite this. The track id is set based on the date and the track number. Whenever you update one or the other, it’s updated as well.

    Happy biking and tracking :-)

    Attachments:
    You must be logged in to view attached files.

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

    #51809
    JScottA
    Participant

    Hi Brendan,

    Thanks for the clarification on Tap Forms 5 and the upcoming Pro version—very helpful!

    To clarify, MCP (Model Context Protocol) is a protocol developed by Anthropic to facilitate integration between generative AI services (such as Anthropic’s Claude chatbot or ChatGPT) and external data sources or tools—like databases for analysis, or computational engines such as Wolfram Alpha for mathematical processing.

    For example, imagine that I have an extensive database on my mountain biking adventures. Yes, I’m aware you are a mountain biker! My database has a lot of details on things like locations, routes, equipment used, points of interest, notable events, maintenance, etc. Using MCP, I could easily connect an MCP supporting chatbot (currently Claude and soon to be ChatGPT, Gemini, and many others) and have discussions with the data. For example, I could ask the chatbot to generate an outline for a book based on my biking adventures outside of Canada. The chatbot would use my TF5 database to access all of the data related to my natural language query and output what I asked for and in the format that I requested it, in this case a story outline.

    A business owner could collect all of the customer reviews and comments and use a chatbot to generate a sentiment analysis from the database.

    Eventually (provided Apple gets actually gets a vision) I could use information a TF5 database combined with Shortcuts/AppleScript to power automation locally like Zapier can currently do over the internet. By the way, Zapier has created 7,000+ MCP connections for powering automations with generative AI. Game changing for the automation business.

    That’s great for Zapier, but I’m looking for a more local solution and a local database that I can build an MCP server to use for my Chatbot to access would be very useful to me and maybe to my clients.

    I know that you are trying to get a new version out the door. So rather than work through getting an MCP server up and running for TF5, I should wait for the next one. If you are able to share information on data syncing or even API access to the new database, that might be helpful.

    #51808
    Hans
    Participant

    Hello everyone,

    I apologize for my long post, in advance ;-)

    Situation:

    For my Form “Tracks” (Tracks for Hike / Bike), there are two important fields:

    1) Creation Date of the Track: The date (typical date field), when the track has been created for the first time. It could be today, or in the past, not in the future. In the past only, when I enter the data today for a track, created in, e.g., 2006.

    2) Track number: It is a text field with two-digit numbers 01-99. It is a text field, because of the missing leading zero (“0”) within the number fields for numbers 1-9. It is mandatory, that the track number is always a two-digit number.

    2.1) The aim of the field is to have a unique number, starting with one (“01”) and should be entered manually, when a new entry is created. It is like a counter: the number of records that have been created per month. It is mandatory that each number within a month is unique.

    2.2) Examples: in January, the first record is 01, the second record is 02 and the third record is 03. In February, the first record is 01, the second record is 02 and so on. March: 01, 02, 03 …

    I need these two fields to create a unique six-digit track ID, which consists of the year (YY), the month (MM) and the track number (xx):

    YYMMxx, e.g. 250401, 250402, 250403, 250404, 250501, 250502 …

    250401 = First record in April 2025
    250402 = Second record in April 2025

    E.g., it is today, and I would like to enter a track that was created for the first time in June 2016. This “new” record is the third record for June 2016.

    The track ID should be 160603 (year = 2016, month = June, and track number = 03).

    After I have entered the Creation Date (1st of June 2016), the script should tell me that for this month (June) in this year, the minimum Track Number must be 03.

    As already mentioned, the problem is that I also create entries retrospectively.

    My question:

    Which JavaScript could I use to check which is the highest number for the the month, for which I would like to create the Track Number? Something like:

    var MinimumTrackNumber = (MAX(TrackNumber)) within ( (YEAR(of Creation Date) + MONTH(of Creation Date) ) + 1; // +1 => one more, than already available.
    
    RETURN("The minimum Track Number for this track must be: " + MinimumTrackNumber);
    

    Thanks in advance. BR

    #51792
    Daniel Leu
    Participant

    The easiest way is using a calculation field. Enable Show reverse relationship in the link field of the parent form. Then in the child field, use a calculation field to propagate the the client name or the project name down the hierarchy. Don’t forget to set the return type to text.

    The other option would be Javascript. You’d need to enable Show reverse relationship, get the parent record from the link field and from there get the field value.

    • This reply was modified 2 months, 3 weeks ago by Daniel Leu.

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

    #51788
    Shane
    Participant

    Hey Brendan,

    Actually I’m looking to pass the data down the hierarchy. So the field data would technically cascade downwards. So one would create client, then from the client add projects. Going to the projects form, one would create tasks for the projects and on each task we would add time tracking entries for billing the client. However to bill the client, the time tracking form would have to inherit project and client data from the top. Through the “link to form” field you can have the child form inherit a single field but the time tracking form would need to inherit two fields of data namely the project and client info. I know, it’s hard to visualize the topology through text.

    The easiest way around it is to just work from the bottom of the hierarchy, namely the time tracking form and manually pick the client, project, and tasks each time one tracks their work but I feel that would be unnecessarily arduous, especially once those forms are well populated. I could do this using PHP/ SQL etc but if I can get Tapforms to handle it, it would save a lot of time from having to manually program everything from scratch.

    I’ve been going through Ford’s JS Tapforms tutorials which have been very interesting and useful. At this point I believe I should be able to somehow use scripts to pass the appropriate field info down the hierarchy to the time tracking form. We shall see. :)

    • This reply was modified 2 months, 3 weeks ago by Shane.
    • This reply was modified 2 months, 3 weeks ago by Shane.
    • This reply was modified 2 months, 3 weeks ago by Shane.
    #51783
    Brendan
    Keymaster

    Hi Groove,

    You’ll need to use a Calculation or Script field to get the total hours on the Link To Form field. And then you’ll need another one on the parent form to display the grand total of them all.

    That’s how you can propagate values from the lower levels of the hierarchy up.

    Thanks,

    Brendan

    Shane
    Participant

    I understand the need for a subscription model. It’s great for developers as it keeps a relatively steady cash flow coming in they can live off of. It’s good for end-users because it means the app will be consistently be supported.

    #51761

    In reply to: Run Fieldscript

    Daniel Leu
    Participant

    Currently, you are using a form script. Change this to a field script (create a field of type script and assign this script to it), then whenever you change one of the source fields, your markdown field will be updated. That should do what you’re looking for.

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

    #51759

    Topic: Run Fieldscript

    in forum Script Talk
    Josef Tingbratt
    Participant

    Hi!
    I have used chatGPT to create a script in a field that creates a nice Markdown filed of parts of my data. It makes it easy to save datain our devops from my meeting-notes and I can still keep track of my records.

    However it only works when I open up the script in edit script and clicks “save”. So I have to that when I cwant to create a markdown. Is it possible to make the script run when a post is saved?

    I have tried ChatGPT here, but it only talks about functions and buttons I can’t find I tap Forms.

    tonyt
    Participant

    Hi Brendan
    How will the subscription work? Per year, per major point upgrade, every other major point upgrade as some other apps do, or something else?
    Cant wait!
    Best
    Tony

    #51749
    Shane
    Participant

    Hello all,

    I’m just starting to learn how to use scripts in TapForms 5. I do have some knowledge of Javascript from a web programming perspective.

    I thought I’d start with something simple such as create a button that deletes a record. I created the button, and assigned the following script which gets the current record, and then attempts to delete it:

    function delete_record() {
    
    	// get current record
    	var thisRecord = record.getId();
    	// delete the record
    	form.deleteRecord(thisRecord);
    }
    
    delete_record();

    The console reports: “deleteRecord: TypeError: Argument does not match Objective-C Class, line:(null)”

    I’m sure I’m doing something really noob here such as combining a record function with a form function.

    Thanks in advance.

    Brendan
    Keymaster

    It will be a subscription. With a period of time discount for existing customers.

    If I continued with a pay once model like I have for the last 16 years, I will not be developing Tap Forms for much longer. And that would make you and I very unhappy. I’ve been working on this new version for the past 2 years. It will be much better as a subscription app because I’ll be able to release new features and fixes as I develop them rather than having to wait so long to bundle them up into a new upgrade. There’s nothing stopping you from continuing to use Tap Forms 5 though. It will still work for years to come. Even Tap Forms 3.5 still works on Sequoia and that hasn’t been updated since 2016.

    As you know, Apple doesn’t support the paid upgrade model in the App Store, so it’s very difficult for developers to offer that kind of service. I managed it with the App Store bundle upgrade feature, but that also meant that I had to keep Tap Forms 3.5 around without updates since then. And Apple actually removed the iPhone and iPad versions of Tap Forms 4 from sale, so the iOS upgrade bundle is no longer available. I’ve just been waiting for them to remove the Mac version too.

    As an indie app developer, I don’t have a huge bank account like medium to large companies do in order to continuously fund new development. I do this because I love it and am passionate about adding cool new things into Tap Forms and interacting with my customers, but I still need to be able to earn a living and pay my bills too.

    I hope you understand my reasoning.

    Thanks,

    Brendan

    Shane
    Participant

    Hi Brendan,

    Will the new version be a paid upgrade or (hopefully not) a subscription?

    • This reply was modified 3 months ago by Shane.
Viewing 15 results - 76 through 90 (of 2,864 total)