Concatenating text from "Link to Form" fields

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Using Tap Forms Concatenating text from "Link to Form" fields

Viewing 1 reply thread
  • Author
    Posts
  • December 28, 2018 at 8:44 AM #33031

    Peter Laundy
    Participant

    When either I print a table or export a set of records, the content from the “Link to Form” fields do not show up.

    Therefore, to get the info that I need to show up (in this case a project number and name) I added a calculation field to the record and tried to use the concatenation option, putting the project # as one string and project name as the other string to be concatenated. It is not working, and looks like this:

    CONCAT(
    COUNT(Projects::Project #);” “;
    COUNT(Projects::Project Name);)

    I got part way to a solution by using a number field for the Project # and simply entered the item into the calculation, The formula worked and looked like this:

    TOTAL( Projects::Project # )

    When I try the same thing with a text field for “Product Name”, however, it would not show up.

    December 28, 2018 at 7:59 PM #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

Viewing 1 reply thread

You must be logged in to reply to this topic.