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 - 466 through 480 (of 2,951 total)
  • Author
    Search Results
  • #49821

    In reply to: conversions

    Glen Forister
    Participant

    I’ve tried to learn, but just can’t spend enough time to remember enough.  Went through quite a bit of a javascript course, but then time got short and I started forgetting stuff.

    If this was a little bit more straight forward, I would try ChatGPT.  I’ve asked it to program some things and I’m amazed at the results.

    The other concern is since I already have 70 records all filled in I don’t want to lose that data, so I have to build in a double if clause that if both fields are filled not to do anything (I guess that would be my first If clause in which all else would occur.

    Some Script help here would be greatly appreciated.

    Thanks.

    #49820

    In reply to: conversions

    Brendan
    Keymaster

    Hi Glen,

    You would need to use a Script field for this. In your Script field you’ll need to get the value of each field. Then do your conversion, then set the value in the other field. Just check to make sure you set the value on the field if it’s empty.

    https://www.tapforms.com/help-mac/5.3/en/topic/javascript-api

    Have you done any scripting in Tap Forms before?

    Thanks,

    Brendan

    #49815
    Pinny Berlin
    Participant

    Hi,

    I have a neat POI form that tracks all of my favorite destinations and uses JavaScript to calculate their distance from my current location. (It sorts by Distance, making it easy to see which places are nearby.)

    I created a POI record called Current Location which I manually update each time I travel. Each other POI calculates the distance away from that Current Location POI.

    I was wondering if there is anyway to automatically update the Location field of my Current Location record. I have googled a bit and see mention of a navigator.geolocation object, but Tapforms throws an error when I try to reference it.

    Does anyone have any other ideas how I might capture my Current Location via JavaScript?

     

    Thanks,

    Pinny

    • This topic was modified 2 years, 2 months ago by Pinny Berlin. Reason: Added photo of Form
    Attachments:
    You must be logged in to view attached files.
    #49811

    In reply to: Setting Current Date

    John Juhl
    Participant

    Hi Brendan,

    thanks for your reply – I don’t recall at the moment what I tried, but from what I can read out of your Script I did get the check-field syntax wrong, since I worked with true/false instead of 0/1.

    It’s a bit late here in Denmark right now, but I’ll have a play with your script first thing in the morning.

     

    Thanks,

    John.

     

    #49802

    In reply to: Setting Current Date

    Brendan
    Keymaster

    Hi John,

    What script have you written to do this?

    Something like this should work:

    function setCurrentDate() {
    var check_field_id = "fld-.....";
    var date_field_id = "fld-....";
    var check_value = record.getFieldValue(check_field_id);
    if (check_value == 1) {
    record.setFieldValue(date_field_id, new Date());
    }
    form.saveAllChanges();
    
    }
    
    setCurrentDate();
    • This reply was modified 2 years, 2 months ago by Brendan.
    • This reply was modified 2 years, 2 months ago by Brendan.
    #49800
    John Juhl
    Participant

    Hi guys,

    I’m trying to figure out how to make this work:

    • I have a CheckMark field
    • and would like to make value in a Date field change
    • when the CheckMark field is Checked

    I’ve tried different Script Approaches, with no luck so far

    How would I do this?

     

    kr.

    John

    #49794
    Daniel Leu
    Participant

    In one of my forms, I encountered an issue of  missing parents. The contact field should contain the infos from the parent. This form script loops over all records of a form and checks if the contact field contains records. If no record is found (eg, length == 0), I set the select field. Afterwards, I can use a smart filter to find all these records where the select field is set to 1. This way, I can verify that these records are indeed the once I want to delete. Maybe this helps you!

    function Select_No_Contact_Parent() {
    
       const contact_id = 'fld-xxx';
       const select_id = 'fld-xxx';
       for (rec of form.getRecords()){
         let contacts = rec.getFieldValue(contact_id);
          if (contacts.length == 0) {
           rec.setFieldValue(select_id, true);
          }
       }
       document.saveAllChanges();
    }
    Select_No_Contact_Parent();
    • This reply was modified 2 years, 2 months ago by Daniel Leu.
    • This reply was modified 2 years, 2 months ago by Daniel Leu.
    • This reply was modified 2 years, 2 months ago by Daniel Leu.

    Cheers, Daniel

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

    #49779
    Kathy Gilchrist
    Participant

    I am struggling with putting together forms for my eBay business.  I tried to modify the Orders/Customer/Product templates but could not work.  Can I speak to someone on this forum to set up my forms for me?

    The forms are:

    On the product sheet, I would like to see a summary of customers who purchased that item, so Name, date, amount, price, shipping, and total (Link to form).

I would like to see a summary of the items purchased on the customer sheet: Product id, Name, quantity sold and total price. (Link to form)

    Transaction/ Product Customer
    Orders
    Transaction Number Product Id Name
    Date Sold Name Address
    eBay Number Description Country
    Quantity Sold Category
    Bids eBay Category
    Sold Price Status
    Shipping Date Listed
    Total Weight
    Refund Amount in Stock
    Date Shipped Start Price
    Date Sold Notes
    Size (S,M, L) Photo  

     

    I have over 7000 orders that I would like to put in a relationship database.  Can anyone help?

    Kind regards,

    Kathy

    #49771
    Daniel Leu
    Participant

    I do something similar in my CRM database: I have a contact form and a notes form (child form). In the contact form, I select a child record using a check mark. This triggers a form script that populates the Notes History field in the parent record. Now I can have a quick look at the notes history of one or more records. There’s a disadvantage: since I update the contact form, the modification date is updated as well.

    The attached image might better illustrate how this works.

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

    Cheers, Daniel

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

    #49766
    Brendan
    Keymaster

    Ya, that’s not possible to change the value of an object on a layout when you select the different child records. You could though, create a Script field to display on the parent record that contains all of the content from the child form for the selected parent record displayed in a different format if you like.

    #49763
    alang
    Participant

    I see.  Particular example is.. Parent form is Authors, Child form is Books (Title, Description).  Parent form Authors has link to form Books.  Idea is on form, Authors to scroll through child records Books and have text box which displays Description field of currently selected child record, Books.  Only at a very high level, any thoughts on how to approach this.  Thank you!

    • This reply was modified 2 years, 3 months ago by alang.
    #49762
    Brendan
    Keymaster

    Hi Alan,

    It’s not possible to trigger a script when Tap Forms scrolls. If you have a script on your child form, it will get triggered when you change a value it references.

    In a script, when your reference record, that’s the current selected record.

    alang
    Participant

    Child records/forms are shown on a form in a table. I would like to have a custom form that displays that child records table and a separate larger text box with particular fields from the currently selected record in the table. This is for readability and editing. There is lots of documentation and discussion about accessing child records; however I do not see how, in a script, you can know which child record in the table is currently highlighted. I am wondering how to do that. And the script would be triggered to display particular fields from the selected child record simply by scrolling through the table. As I understand it, a form level script is triggered when a referenced field is changed. But simply scrolling would not change a field. So, the questions are, how to know what the currently selected child record is and how the script would be triggered by simply scrolling to a new record in the child table. Or perhaps there is a better way to approach this?

    Thank you,
    Alan

    #49747
    Glen Forister
    Participant

    I successfully installed a stepper with your help (“You would need to use a Script Field to manage this.”)

    I wanted to edit this and do it again on another Form, but I can’t find it.  How do I find it to use as an example.

    #49730
    Daniel Leu
    Participant

    The form script is an example on how to fetch the data. It doesn’t populate the fields.

    There is a field script that uses the ISBN number as input and populates the fields of the given record. Enter the ISBN number a new record and click on “recalculate formulas” or cmd-r to get it executed. This will populate all fields of the record including the cover image.

    Can you give the ISBN number of one of your books you’re trying?

    Cheers, Daniel

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

Viewing 15 results - 466 through 480 (of 2,951 total)