Discussions

 View Only
Expand all | Collapse all

Pipeline Simultaneous Multiple and Single Record Creation Ideas

  • 1.  Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-21-2022 13:21
    Hi,

    I am working on a workflow solution and am struggling to solve a problem. Hoping someone in the community who has a bit more experience with pipelines may have a (relatively) straightforward solution I'm not thinking of.

    Here is what I'm looking to accomplish:
    Two tables involved:
    1. Parent table  = A
    2. Child table = B

    Each month, users will have a grid edit report where they can see their B records from the prior month. My idea is they will check the renew checkbox field on this report for B records they want to renew for the current month and save the report. The past month's records will need to stay associated to their A record, so copies of the renewed B records will need to be created and associated with a new A record.

    The question I have is, how do I get the trigger to recreate (copy) the B records for each trigger, but only create a single A record to tie them to. Example, a user wants to renew 6 B records, so I would need 6 new B records created, but only 1 A record created that all 6 Bs will be tied to. Ideally I want to accomplish this in a single pipeline, if it's not possible then that is good to know. I'm open to other solutions. I feel like this is just an order of operations solution that I can't wrap my head around currently.

    Thanks in advance for the help!

    ------------------------------
    Curtis Middleton
    ------------------------------


  • 2.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-21-2022 15:34
    To add to this, an idea I had was to have it search A records for an existing record by the end user that would meet certain criteria and if it found one, then to not create a new record. Just not sure how that look from a functional standpoint in pipelines and if that would add a significant amount of run time if it was doing that a dozen times. Though, not sure if there is a more efficient way to implement that.

    ------------------------------
    Curtis Middleton
    ------------------------------



  • 3.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-21-2022 16:25
    Would it be at all practical to have a button either on the A record or the B record which would be visible in view mode (not grid edit) which would copy the A record and ALL its children and immediately land the user on the New A with its duplicated children. Then the user would use the checkbox on the embedded report to delete the unwanted children?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 4.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-21-2022 17:04
    Hey Mark,

    Thanks for taking the time to look at this and I appreciate the alternate solution idea. It is a possibility.
    We don't allow the end user's to delete records, though I am looking to build in a cancel/remove button functionality which would operate in the same way as what you are getting at.

    For my app, it would probably make most sense to have that button on the A record. My concern with a button is for it to finish running the copy/recreate before landing them on the newly created A record.
    How do you envision this button workflow operating? Would it trigger a pipeline?
    I'm familiar with both a formula and pipeline solution based on what you are getting at so you can just give me a relatively high-level idea. But as I mentioned, based on my past experiences I'm concerned about the runtime.

    Thank you!

    ------------------------------
    Curtis Middleton
    ------------------------------



  • 5.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-21-2022 19:33
    One way would be to use the built in Copy Master Detail wizard button maker which is located on the App Management page.  This can also be done with a URL

    Select Copy the "Project" or whatever your A table is called and then just specify which relationship you want children copied.  Post back if you get stuck.

    As for deleting, you could have a checkbox called deletion requested, and then a Pipeline run when that field was checked and perhaps some other conditions were true such as the date created  = date modified of the parent record (meaning that the parent had never been edited, or perhaps only for children created today.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 6.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-22-2022 06:57
    Mark, maybe off topic, happy to create a different post on this... but have you had any success implementing the "copy master detail" process into a pipeline?  I've been picking away at it and can't seem to make it work; this thread jogged my memory.

    What I'm trying to do, is copy an existing record with children, and apply it to a new parent record.  I have a button launching a miniform, select the child to copy.  This triggers a pipeline which will in theory copy master detail, then find that new record, and change a few fields to relate it to the new parent.  

    I'm trying to use the QuickbaseAPI -> Make request as shown, hacking up the parts of the generated code to attempt to get the end result.  Pipeline runs successfully, but no new record is created...Thoughts/advice?


    ------------------------------
    Jeremy Myer
    ------------------------------



  • 7.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-22-2022 13:59
    Can you clarify this?

    What I'm trying to do, is copy an existing record with children, and apply it to a new parent record.

    I don't understand about the parent record. Which process is creating the new parent record, the copy master detail or is the user creating the parent manually and they want to copy children from another Parent.  Why can't you just use a regular copy master detail formula URL button to do this?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 8.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-22-2022 15:25
    Hey Mark, sure, although I have solved this problem this morning, maybe it helps someone else out down the road.

    The short answer to your question is the latter, the user creating the parent manually and they want to copy children from another Parent

    I have Parent record #3, it currently has children 3a, 3b, 3c.  the children have children and so on.  "Copy Master detail" of 3c creates 'copy of 3c'.   What I need to do, very invisibly to the user, is change the related parent "3" to a new parent 9, and rename it 9a.  So I wanted, in an easy way for non-technical folks, and without the ability to really mess things up, was a pipeline to do this.  

    I can't use the always import from a specific record option, as I need it to be super flexible, it's not always the same original template.

    In the real world situation, we do testing on products as part of a project.  For a new <parent>project, I need the ability to recall any test ever done, and recycle the <children>test steps, the <children>widgets used, other <children>parts of the old test.  So the user creates the new project, then goes to the 'copy an old test' and picks the old test from the list of old tests.  I considered the idea of templating these tests, but aborted on that as just too cumbersome to keep up to date, when the users are creating new tests all the time.  So we came to this solution.  Maybe not elegant, but saves a lot of time re-creating stuff.  Pipeline is below, I just needed to move one bit from the body to the header. 

    ***If anybody has a different solution for this, I'd love to hear it***

    Thanks



    ------------------------------
    Jeremy Myer
    ------------------------------



  • 9.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-22-2022 15:46
    @Curtis, So I also have a similar use case where the user wants to copy essentially the entire test, except for a few test items.  In this case *my* A record always has fewer than 10 B Records, so ​this solution would work for me. 

    ***As yet undeveloped, still brainstorming the best way for this option***

    On the A Record, i will have a button to create a copy of the A record.  This will open an Add record form in my "Temp Data" Table. 
    • In the button click, I send a concatenated text field with the Record ID/names of the related B records
    • In the Temp data table, I will parse the concatenated text field into its component parts 1-20.   **If your B records are more than 20, this wouldn't work**
      • Part 1/Record B1 name
      • part 2/Record B2 name 
      • and so on
    • I will have fields in the temp data table for use this one or not
      • Checkbox 'use part 1/record B1'
      • Checkbox 'use part 1/record B2'
      • and so on
    Then, on record save/add in the Temp Data Table, I trigger the pipeline to 'Copy Master Data' copying Record A, then according to the checkbox fields, delete the records the user didn't choose.  Since it's handled in a pipeline, the user permissions don't have the ability to delete, but the bot does, so it's safe-ish...

    I assume that within the pipe, if needed, search for the newly created record and re-label some stuff based on other fields in the temp data record.  i.e.. have a field for [title of the new record] = "Jeremy's April Report" and a step in the pipeline would change the record name from "Copy of Jeremy's March report" to "Jeremy's April report"

    ------------------------------
    Jeremy Myer
    ------------------------------



  • 10.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-22-2022 20:03
    Jeremy
    so given your explanation, I am not seeing why you could not do this all in a formula URL button. Copy master detail is a API call.

    The API would create the children and then redirect to Land the user on the project record.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 11.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-23-2022 15:47
    Edited by Curtis Middleton 03-23-2022 15:48
    Thanks Mark. Never knew this wizard existed. I usually create my formulas from scratch, so I appreciate the knowledge.

    As for the the formula itself, the code is slightly different than what I'm familiar with. If I want to modify the formula to leave certain fields blank (Example: We have a checkbox we still want them to manually check after reviewing their request before submitting), would I add that in at the end of this section like other rich text formulas? First is the original section and second is my proposed modification (underlined):
    '&relfids=11&copyFid=27&destrid=0&sourcerid=" & [Record ID#] & "'
    so it might say something like:
    '&relfids=11&copyFid=27&destrid=0&sourcerid=" & [Record ID#] & "&_fid_86=false"  & "'

    ------------------------------
    Curtis Middleton
    ------------------------------



  • 12.  RE: Pipeline Simultaneous Multiple and Single Record Creation Ideas

    Posted 03-23-2022 16:15
    ah no, you cannot blank out fields on the fly with that API.  It's not ab supported parameter.  You would need to trigger a pipeline to blank out the fields.  But it would need to know that the children records were auto created somehow so it knew which ones to blank out.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------