Forum Discussion

ArkadyGranik's avatar
ArkadyGranik
Qrew Cadet
4 years ago

Establishing relationship automatically

Hello,

I am working on survey report. Depending on survey outcome, I'd like to request additional notes.

Structure is as follows:
Require Notes (yes/no) -<Survey Q&As -< Notes

I am trying to create a conditional dropdown in Notes, so it shows a list of Survey Q&As that are related to "yes" record of Require Notes only.

Before doing this, I need to create relationship between "yes" record of Require Notes and Survey Q&As; but I would like relationship to happen automatically (when "add notes" check box is ticked in Survey Q&As) .

I would also like to have every record of Notes table to be automatically related to "yes" record of Require Notes.

Is this possible? Is there another way of doing this?

Thank you for your help.

------------------------------
Arkady
------------------------------

3 Replies

  • Hi Arkady, to relate all the Q&A records automatically to the "yes" record, you can set the reference field with a default value. For example, let's say you're using Record ID# as the key field on the table where the "yes". Let's also assume for a minute that the Record ID# for the "yes" record is 1. Then, you can edit the field properties for the reference field and set it to 1.

    ------------------------------
    Brian Cafferelli
    ------------------------------
    • ArkadyGranik's avatar
      ArkadyGranik
      Qrew Cadet
      Hi Brian,

      Thank you. I believe I am allowed to set field containing "yes" or "no" answer as a key field. As the table has two records, key field will be unique. This way I should know the record I need.

      What I have not figured out is whether I can use formula to set value to Related Require Note fields in Survey Q&As and Notes tables. I do not want to do this using Dynamic Form Rules in QB forms as records will be added and edited using Grid Edit.

      I suspect Automation might be the answer.

      What do you think?

      Arkady

      ------------------------------
      Arkady
      ------------------------------
      • ScoutPup's avatar
        ScoutPup
        Qrew Member
        Yes, you can set a text field to be the parent table's key field. If you do, then your reference field would also be text. I like how you're thinking about this, and I recommend building a pipeline to fill in that reference field.

        The pipeline would trigger when the record is created, and move the text value into the reference field. That way it will be consistent, even when your users are in Grid Edit mode.

        ------------------------------
        Brian "Actual" Cafferelli
        ------------------------------