TF5 script broken in TFP

Viewing 4 reply threads
  • Author
    Posts
  • May 9, 2025 at 2:56 AM #52168

    Simon Spiers
    Participant

    Hi Brendan,

    I really like the new Tap Forms Pro — Thank You!

    I migrated from Tap Forms 5 and one of the scripts no longer works. It gets the values from a linked form and populates fields in the current form.

    How can I make it work again?

    Thanks in advance

    Attachments:
    You must be logged in to view attached files.
    May 9, 2025 at 11:24 AM #52180

    Daniel Leu
    Participant

    There’s seems to a slight change in the API that sessions is now an array. I discovered this yesterday. With the link, there can only be one element. So adding following after the var sessions =.. line should fix it.

    sessions = sessions[0];

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

    May 9, 2025 at 4:15 PM #52184

    Simon Spiers
    Participant

    Thanks Daniel. I converted sessions to an array and didn’t get an error. Interestingly though, it then only populated the empty date field, and not the two other empty text fields. I worked out that the empty date field is undefined while the empty text fields are no longer undefined but ''. It’s now working again.

    Thanks for your help.

    May 10, 2025 at 11:11 PM #52190

    Simon Spiers
    Participant

    Another question. In TF5 the ‘Session surgeon’ and ‘Session hospital’ weren’t text fields but links from separate forms. The script was able to extract the values and populate fields in the present form. In TFP the ‘linked to’ fields don’t appear in the scripting window and it doesn’t appear on the face of it to be possible to get the values. Or is it?

    Attachments:
    You must be logged in to view attached files.
    May 11, 2025 at 8:52 AM #52196

    Daniel Leu
    Participant

    Strange! They should be there as well if properly linked. Maybe something happened during the migration. Check your form that the fields link to the proper forms and that the _Show Reverse Relationship_ is checked.

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

Viewing 4 reply threads

You must be logged in to reply to this topic.