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 - 2,716 through 2,730 (of 3,049 total)
  • Author
    Search Results
  • #33109
    Brendan
    Keymaster

    Well, with a Link to Form field, there’s no way in a Calculation field to reference an individual child record. So the only way to do it is to use JavaScript.

    Going the other way was just a suggestion.

    #33108
    Brendan
    Keymaster

    Well, you could simulate a button by adding a Checkmark field to your form and then reference that Checkmark field in your script. When you tap the Checkmark field, the script will run.

    #33102
    Victor Warner
    Participant

    Brendan,

    Thank you for the reply.

    The script example, unfortunately, is beyond me (having no knowledge of JavaScript) at present.

    I am not sure that I understand, fully, the following:

    “then you could add a Calculation field to your Passports form that references the Client Contact data. In that situation because it’s as One-to-Many relationship, the inverse of that is a Many-to-One and you can reference individual fields from the one Client Contact record from within the Passport records.”

    These seems to be suggesting the reverse what I am seeking.

    I am not seeking to reference individual fields from the Client Contact record, but rather, the reverse, some fields from one of the records in the Passport form.

    As I am new to Tap Forms I suspect I am missing something – further help would be greatly appreciated.

    #33101
    Ian Heath
    Participant

    Any plans to add this to iOS versions, or if not layouts at least a simple button option in place of a field to trigger a given script. I think that’d be a great enhancement.

    Cheers Ian

    #33094
    Brendan
    Keymaster

    Oh yes. That’s right. Sorry about that. Custom layouts are only available on macOS and that’s why there’s no button function in the iOS version. You have to use the Run Script menu to activate a Form Script on iOS.

    #33088
    Brendan
    Keymaster

    You’ll have to use a Script Field for this because the Calculation field cannot reference specific sub-records of a Link to Form field.

    var passport_field_id = 'fld-....';
    var passportRecords = record.getFieldValue(passport_field_id);
    if (passportRecords.length > 0) {
       var firstPassportRecord = passportRecords[0];
       var number_field_id = 'fld....';
       var number = firstPassportRecord.getFieldValue(number_field_id);
    
       // and do whatever you want with the values/
    
    }

    Hope that makes sense.

    But what you could do maybe instead of trying to extract the passport information on the Client Contact form into a Calculation field, you could go the other way around and if you’re using a One-to-Many Link Type from Client Contact to Passports, then you could add a Calculation field to your Passports form that references the Client Contact data. In that situation because it’s as One-to-Many relationship, the inverse of that is a Many-to-One and you can reference individual fields from the one Client Contact record from within the Passport records. You’ll notice that if you double-click on the inverse field of a One-to-Many relationship in the Formula Editor, you’ll get something like Client Contact::First Name instead of one of the aggregate math functions.

    Thanks,

    Brendan

    #33074
    Brendan
    Keymaster

    Hi Ian,

    On a custom layout you can add a button which you can click on to trigger a Form Script.

    Click the custom layout, then the Layout button. At the top-right of the Layout Inspector panel you’ll see a “button” button. Click on it, then drag out a rectangle on your custom layout. Now on the Layout inspector panel you can set the Form Script to trigger when you click the button.

    Hope that helps!

    Brendan

    #33071
    Ron
    Participant

    Check out the Scripts page of the v5.3 manual. It gives a sample of the Prompter() function which seems to be what you are looking for.

    Ron

    Ian Heath
    Participant

    Is there a way to use the share/send-to option on iOS Safari to pass information to Tap Forms? What I’m thinking is some sort of bookmark manager functionality so I’d want to pass the URL and title into a predetermined database. Alternatively would this be possible via a Safari bookmark with some Javascript in it, like I’ve seen for other bookmarklet functionality in the past?

    #33068
    Ian Heath
    Participant

    I’m making a cataloguing database for things like DVDs and am using the example script in the script help section of this website (which uses the barcode/UPC to do a lookup to the Internet to get the product details). What I would like to do is to have a button on the form to trigger the script (rather than having to select it from the menu, which I feel is less intuitive/convenient), but I don’t think this is possible? (I would love that as an enhancement!). I’ve read a few forum posts on the subject of script updating and aren’t sure what it’s best to do. Since the service used for the lookup is limited re. the number of lookups (for the free service) I want to limit the quantity of lookups, i.e. I was thinking of writing per field scripts that returned the specific value based on when the barcode/UPC value changed, but this would increase the number of lookups. Also I would like to be able to choose when to do a lookup, hence the desire for a button/trigger. Thanks in advance.

    #33061
    Aeron Manabo
    Participant

    Hi,

    I am currently interested with the scripting capability of TapForms to apply on my workflow. I would like to ask for help or maybe scripting samples for this conditions:

    1. To Create a New Record.
    2. To Put the Current Date in a Date Field.

    (Much better if I am able to have a prompt to input details to specific fields [e.g. date, week number, etc.])

    Thank you so much for your help on my learning journey. :)

    #33060
    Brendan
    Keymaster

    Hi Ian,

    I have a fix for that coming in the next update. Sorry about that.

    It’s doing that only if you’re editing a Script field. It doesn’t crash when tapping that button when editing a Form script.

    But all it will have in there is the Run Script command which you can access by tapping the run button on the toolbar above the keyboard.

    Thanks,

    Brendan

    #33058
    Ian Heath
    Participant

    Hi, A newbie here, just purchased this today on iOS and planning to get the macOS version very soon. First impression is very good. No doubt I will have some other questions but my first one is a consistent crash I can cause.

    It’s when I’m looking at a script in the forms view and select the option in the screenshot (top right of screen).

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

    Hi Peter,

    This is because in a Link to Form field there can be multiple child records. So which record are you trying to reference? The Calculation field doesn’t let you reference individual records from a Link to Form field. You can only get an aggregate result. For Number, Calculation, and Rating fields, you can get the Total, Average, Minimum, or Maximum value from the child records for the specified field.

    You will need to use a Script field instead to be able to reference a specific child record from a Link to Form field. Something like:

    function getFirstProjectName() {
       var projects_field_id = 'fld-....';
       var project_name_field_id = 'fld-....';
       var projects = record.getFieldValue(projects_field_id);
       var firstProject = projects[0];
       var projectName = firstProject.getFieldValue(project_name_field_id);
       return projectName;
    }
    
    getFirstProjectName();

    Thanks,

    Brendan

    #33020
    Victor Warner
    Participant

    I am creating a database to record subscriptions and have set up fields to show

    1. name of subscription;
    2. period of subscription (yearly, monthly, 2 yearly);
    3. type of subscription (eg work, domestic, software);
    4. amount of subscription

    among others.

    I can see that one of the options is to group records. If I choose type of subscription and Multi-Column View then I can group on headings for work, domestic, software and choose and as a sort field type of subscription so that within each heading the subscription are sorted by the period.

    As far as I can work out it appears is not possible to have 2 level Group by Records.

    For example, rather than having

    Work
    domain registration,2-yearly,£9.99
    tap forms, monthly, £150.00
    365 office, monthly,£59.00
    office insurance,yearly,£300.00
    professional indemnity insurance,yearly,£1,500.00
    Total £2,108.99

    Instead:

    Work
    2-yearly
    domain registration, £9.99
    £9,99

    monthly
    tap forms,£150.00
    365 office,£59.00
    £209.00

    yearly
    office insurance,£300.00
    professional indemnity insurance,£1,500.00
    £1,800.00

    £2,108.99

    Is this type of 2-level grouping available in Tap Forms?

Viewing 15 results - 2,716 through 2,730 (of 3,049 total)