Forum Discussion

PrashantMaheshw's avatar
PrashantMaheshw
Qrew Assistant Captain
2 years ago

(Video) Become Multi Select Hero by Automating Multi to Multi Relationships

I would be the first to admit , multi to multi is a pain to setup . In this video we are automating the process of Multi to Multi by using form rules and pipelines (Jinja). See the video here

Purpose of the video is to get your creative juices going , this is again version 1 and very basic , I can give v2 if needed.

1. I' have purposefully chosen food as it's very easy to understand
2. Quick Adoption of this includes Team Members for a given project (who are not users) , Simple BOM items from a dropdown


VIDEO

Become Multi Relationship Hero with Form Rules & Pipelines
Loom remove preview
Become Multi Relationship Hero with Form Rules & Pipelines
View this on Loom >




------------------------------
Prashant Maheshwari
------------------------------

6 Replies

  • DonLarson's avatar
    DonLarson
    Qrew Commander
    Prashant,

    I have the Quick Fill formula working now on the form.  There is a key piece that cannot be seen in your video.   The form rule that writes the formula to the text field has to have the check box cleared in the Options section. 

    That is blocked by the circle where the camera capture is displaying.


    I also took the formula and exploded it into components so I could figure out what was happening in it.  Here is a link to my longer version with comments:

    https://github.com/mcfindustries/Magic/blob/master/Community/Quick%20Fill%20Formula.quickbase


    Now I have to replicate the Pipeline action to create the records in the M2M.





    ------------------------------
    Don Larson
    ------------------------------
    • PrashantMaheshw's avatar
      PrashantMaheshw
      Qrew Assistant Captain
      HI Don,

      Thank you for your feedback. I will definitely make a v2 . 

      Absolutely love your detailed GitHub comments , it makes it so much easier to explain what I was mumbling about. I'm still hoping this form rule is as useful in problem solving for you. 

      For pipeline you can either use extract regex or version below by @Doug Henning in my earlier post . Modify below to set your fields setup. 

      {%- set plist = a.quick_capture.split(';') -%}
      {
        "to": "br8hpcpk7",
        "data": [
          {%- for x in plist if x|trim != '' %}
            {
              "18": { "value": "{{a.related_director}}" },
              "89": { "value": "{{a.id}}" },
              "6": { "value": "{{loop.index}} {{ x|trim }}" }
            }{{ ',' if not loop.last }}
          {%- endfor %}
        ]
      }​​

      ​​​

      ------------------------------
      Prashant Maheshwari
      ------------------------------
      • DonLarson's avatar
        DonLarson
        Qrew Commander
        Prashant,

        I am close on the Pipeline but do not really understand it.   I have figured out where my issue is.   

        I created a text field of the Reference Fields in my Quick Fill

        [3;5;6;4;7]   these are the RIDs of my Items selected.

        The split is producing a JSON list

        { 1 3
        2 5
        3 6
        4  4
        5 7}

        when the loop tries to write that to the Related Item it is incompatible.  I found that out by writing to a text field instead of the Related Item field.

        I assume that {{x|trim}} is meant to remove the index value but it is coming through.

        ------------------------------
        Don Larson
        ------------------------------