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 - 91 through 105 (of 2,864 total)
  • Author
    Search Results
  • #51739
    Hans
    Participant

    @Daniel / @Brendan : You made my day! Thanks! The script is running, and I already use the structure of the script for other use cases.

    #51735
    Hans
    Participant

    Thank you for your prompt feedback. Yes, the field was unfortunately empty, and now I get the values. It was for sure a beginner’s mistake.

    Now I have the values:

    {
        altitude = “yyy.xxxxxxxxxx”;
        heading = “z”;
        lat = “45.xxxxxx”;
        lon = “12.xxxxxx”;
        pitch = 0;
        title = “street, ZIP city region, country”;
    }
    

    Now I know that this is the output of a dictionary, which contains keys (e.g., “title”, “lon” …) and values (e.g., 45.xxxxxx).

    Question: What do I have to do now to get the value from the key “title”, for example?

    The suggestions here in the forum or on “stack overflow” have only produced errors within the script, and unfortunately, I don’t understand why – maybe because I am a beginner ;-).

    If I get this solved, I have the form of “POIs” ready and can then develop all the other forms further, as I have similar queries here.

    Many thanks in advance.

    Best Regards, Hans

    #51733
    Hans
    Participant

    Dear forum participants.

    Briefly about me, my question (problem) below.

    For over 8 years, I have managed my data with a NINOX -DB. I have tested Tap Forms sporadically, but I would rather not try the scripts. Well, from today’s perspective, a mistake ;-)

    Finally, I found my way to Tap Forms, and I am very enthusiastic because Tap Forms offers everything I had before, and it is even easier and much more stable than NINOX. And I also get along well with JavaScript so far.

    My DB is used:

    • POIs (Point of Interests) for hiking, biking, and photography
    • Tracks and routes: Record tour data (places, countries), types (MTB, hiking), difficulty (S0, S1, …), duration of a tour, with breaks, etc., weather data, and much more.

    To my question, for which I need your support:

    Goal: I would like to place the content from two different fields in a third field:

    1)) Source: “Name of the location”
    2)) Source: “Address of the location”
    3)) Target: (“Name of the location”, “Address of the location”)

    However, with a simple console query, I only get the error message “undefined”.

    Script:

    function Addresse_mit_Name() {
    
    	// field: address of the POI
    	// 1st row: street, ZIP, city
    	// 2nd row: lat & lon (GPS)
    	//
    	var adresse_des_poi = record.getFieldValue('fld-2a75296d19a64123ba33be5a6e5808ba');
    
    	// check values of field
    	console.log(adresse_des_poi);
    
    	// return of combined values
    	return(adresse_des_poi);
    }
    
    Addresse_mit_Name();
    

    Question:

    What do I have to do to get the address from the location field, which I can then process as a variable?

    Source field:

    1)) Address
    Type “location”
    Name: “Address of the POI”
    field-ID: ‘fld-2a75296d19a64123ba33be5a6e5808ba’

    Many thanks in advance for your support.

    Best regards, Hans

    #51728
    Brendan
    Keymaster

    I’m not sure what you mean by “a way/ or script that can be made to download all to one document”. Do you mean you want to import into a different Tap Forms document?

    It sounds to me like you’re building a website and want to display your images from Tap Forms on the web? Then you could just take the images exported and upload them all to your images folder on your website and then update the HTML to reference the images appropriately. Tap Forms will include the image name in the CSV file export that matches the export. If you want to make it easier for yourself, you could add a Calculation field which generates a path to the photos that’s appropriate to reference on your website. So it would just be a matter of importing that CSV file into your website and then uploading the images to the right folder.

    Thanks,

    Brendan

    #51726
    CreativeGal
    Participant

    Hello, I am looking for a way to be able to download some information from Tapforms to put into a spreadsheet for my Wix website portfolio/shop form. I have added a screenshot of what I am trying to achieve. (Image, SKU Number, Name). Currently when I export the information the images go into their own folder and I have to match each one of them up to their information. Is there a way / or scrip that can be made to download all to one document?

    I’m not sure if it is a script that is needed or a different way to export. Any suggestions would be helpful.

    Many Thanks

    Attachments:
    You must be logged in to view attached files.
    #51723
    pierrot_rennes
    Participant

    Hi Brendan,

    Thanks for your help
    I tried it, but it didn’t work.
    I probably didn’t understand how to insert or modify the script.
    Here’s a screenshot.
    I assumed I had to insert the form name into the script.

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

    Hi Pierrot,

    Yes, you would need a script to get the counts of the individual forms and searches.

    I should make it easier to get those counts, but for now something like this should work:

    function getCountsOfFormRecords() {
       let theForm = document.getFormNamed("The Form");
       let theFormRecords = theForm.getRecord();
       return theFormRecords.length;
    }
    getCountsOfFormRecords();
    
    #51717
    pierrot_rennes
    Participant

    Hi,

    I have a database with 4,400 records spread across several subforms.
    I would like to create a table-based form to count the totals of certain fields in the subform records.
    Is it possible to retrieve the column count value, and how do I build the form? Is there a script?
    Thank you for your help.

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

    1.) Is there a way to find the selected cell in a column from a table field? (image attached)

    AFAIK, the select state of a cell or row is not exposed.

    2.) Can I call a File open window to select a file on my hard drive to get a UNIX file path?

    To open Finder, you can use Utils.openUrl("file:///Users/josef/Desktop");. For this to work, you need to set the script access folder.

    To get the file path, control-click, middle mouse button, or two-finger click on the file to get the context menu, press the option key and select Copy “xxx” as Pathname.

    Then you can write a script that gets the copied Pathname from the clipboard using Utils.copyTextFromClipboard() and proceed with processing it. To trigger the script, you can use a checkmark field like you launch the play in VLC script.

    You can automate this further: Create an AppleScript that is selected from the Quick Actions context menu. This script would get the file path and then call a TapForms script using tapformz://script/db-xxxx/frm-xxxx/Test+Script?option1=A&option2=B. Most likely you would have to provide the id of the record and the id of the table row record as parameters. This script would then store the file path in your table.

    Sounds like a fun project!

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

    #51714
    Josef Senti
    Participant

    Hello

    1.) Is there a way to find the selected cell in a column from a table field? (image attached)
    2.) Can I cal a File open window to select a file on my hard drive to get a UNIX file path?

    I’d like to write a script that can write the path of a file in a selected table cell.
    Or by input window, but ideally with a window that let me select the file on the hard drive.

    For example:

    Open file search window
    Get the UNIX path of that file
    Add “file://” in front of that path
    Look for the selected cell in the column
    Write the path in that cel

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

    You’re using a custom layout. So you can add a button that will launch a form script.

    What you do is get the field value of your table field. This is an array of records. Each record represents a row in your table. Then you just loop over it and clear the checkmark field.

    Here’s the form script. You just have to set the ID of the aforementioned fields

    function Clear_Checkmarks() {
    	const table_id = 'fld-xxx'; // id of your DVD Verwaltung table
    	const table__check_mark_id = 'fld-xxx'; // id of your Gesehen field
    
    	let tableRecords = record.getFieldValue(table_id);
    	
    	tableRecords.forEach((a) => {a.setFieldValue(table__check_mark_id,0)});
    	document.saveAllChanges();
    }
    
    Clear_Checkmarks();
    

    ;

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

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

    #51707
    Josef Senti
    Participant

    I have a lot of rows in a table field. One of the columns is a checkmark field to take record if I have seen this episode. (image in the attachment)

    Now I try to write a script that sets all the checkmarks to false in this table for this series.

    I found out how I can change a checkmark field alone, but not when it’s in a table.

    Can someone pleas help me.

    Ideally I’d like to press a shortcut and all the checkmark fields in this table get set to false.

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

    Based on something I already have and use, I propose following:

    I’m using a checkmark field to trigger the opening action of a PDF file. You can use the same code to trigger opening your video.

    Add two fields to your table, the checkmark field called Open and a script field (use a meaningful name). For usability, place the Open field in the first column. You can hide the script field.

    Here is the script code. You have to update the open_id and link_id constants to contain the IDs of the Open field and the Pfad field.

    function Attachment_Open() {
    
    	const open_id = 'fld-xxx'; // id of the newly created checkmark field
    	const link_id = 'fld-xxx'; // id of your Pfad field
    
    	let open = record.getFieldValue(open_id);
    	let link = record.getFieldValue(link_id);
    	
    	if (link && open){
    		console.log("Opening URL " + link);
    		
    		link = "file://" + link.replace(/[ ]/g, '\ ')
    		console.log("Opening URL " + link);
    
    		Utils.openUrl(link);
    
    		// clear opening flag
    		record.setFieldValue(open_id, false)
    		form.saveAllChanges()
    	}
    }
    
    Attachment_Open();

    Now, when you click on the Open checkmark, VLC should open your video.

    In case it doesn’t work, please open the console and then click on the Open checkmark of one of your videos. Then report the console output.

    Good luck!

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

    #51703
    Josef Senti
    Participant

    Thank you!!

    I have all the series in a table, like in the image attached. Where do I put the script and haw can I call the path in that script from the selected row?

    Sorry, I’m all new to this ;)

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

    Using a script:
    You can use Utils.openUrl(url); to open an external file. Use following scheme to set an url to point to a file on your disk: url="file:///Users/daniel/Desktop/song.mp4".

    This will open the file in the predefined handler for that file type. This script can be assigned to a button when using

    Using a website field:
    You can assign the path using the url format shown above. When clicking on the globe, the file will be opened in the handler for that file type.

    So for both cases, you must make certain that the VLC Player is the default player for your iso and mp4 files. If this is not practical, it might be possible to use the VLC url scheme: url="vlc-x-callback://x-callback-url/stream?url=file:///Users/daniel/Desktop/song.mp4"

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

Viewing 15 results - 91 through 105 (of 2,864 total)