Conditional Dropdown displays separate lists based on 2 different forms in one table

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered
I recently just added an additional Form and Add Record Button to map to that form.  My question revolves around a conditional dropdown box based on what form is being used. 

This Add Record button points to the original form with Form ID = 2.  I would like a formula that references the Form ID so I can then point the formula that drives my conditional dropdown for that specific form.  For example, this Form is for Planning.

URLRoot() & "db/" & [_DBID_PLANNED_TEST_CASES] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])& "&z=" & Rurl()


This Add Record button points to the NEW form with Form ID = 10 and is for Authoring.

URLRoot() & "db/" & [_DBID_PLANNED_TEST_CASES] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])& "&z=" & Rurl()& "&dfid=10"


I would  have to have a few additional fields. [Helper for Conditional Dropdown] and the Formula fields that help me reference the Form IDs.  The  [Helper for Conditional Dropdown] could then reference those formulas from their respective forms.


Yikes!  Make sense?


Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb

Posted 4 years ago

  • 0
  • 1
I think that you are asking how to populate additional fields when the from pops up??? Note tat you are already populating the field ID 7 which is your child field called [Related Parent] with the value of the record ID of the parent.

URLRoot() & "db/" & [_DBID_PLANNED_TEST_CASES] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])
& "&_fid_50=" & totext([some numeric field])
& "&_fid_51=" & URLENCODE([some text field that might have spaces or special characters])
& "&_fid_52=1" // make a checkbox field true
& "&_fid_53=0" // make a checkbox field false
& "&z=" & Rurl()& "&dfid=10"
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
Hey Mark.  I added a picture in hopes to help.  An easy fix to my question is to make my helper for cascade dropdown field a multiple choice field, but i dont want the user to have to pick Planned or Authored.  I want it to be seamless based on the button they choose taking them to the form.  The form is dictating Planned vs. Authored.  Did that clear anything up as well as the picture?  

And maybe the code you have there does the trick and i dont quite understand it??  Where does the Planned vs Authored come into play?
I'm not understanding.  You have two buttons built and you want to user to just be able top click on one button and have it drive the correct URL.  How does the record know which button it should use?
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
Let me start from the beginning because i have an unexpected issue.  Forget about the Conditional Dropdown part for now. :smile:

I am trying to record two types of data in one table.  The Parent Table is Application Team & Child Table is Test Cases (TCs).  The two types of TCs i am tracking are Planned & Authored.  From the Parent, if i was to select App Team "ABC", on the Parents form, i would see two buttons, one that points me to the first form in the Test Cases Table and one button that points me to the second form in the Test Cases Table. (so to answer your question, one button would read Authored and one Planned....that way you know which you want to pick).  

Form 1: the code and button name Planned = URLRoot() & "db/" & [_DBID_PLANNED_TEST_CASES] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])& "&z=" & Rurl()

Form 1 Fields:  [Original TC Count (Planned)], [App Testing Start Date (Planned TCs)]

Form 2: the code and button name Planned = URLRoot() & "db/" & [_DBID_PLANNED_TEST_CASES] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])& "&z=" & Rurl()& "&dfid=10"

Form 2 Fields:  [Original TC Count (Authored)], [App Testing Start Date (Authored TCs)]

I selected the AUTHORED button and entered data on Form 2.  When i selected save, i got this error.

The following required fields are missing:

"Original TC Count (Planned)", "App Testing Start Date (Planned TCs)"

Please include the required field(s) on this custom form or give each of them a default value.

I assumed a new button means i could enter what ever i wanted on the new form???  I guess that isnt true?  How can i do what i am trying to do?  Thanks again Mark....wish there was an emoji for "bang head here"
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
UPDATE...ok, i removed the required aspect from the field and it saved.  I will have to build that in on each form i guess.  I'll try to explain the conditional dropdown better now.
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
The Conditional Dropdown is based on a Release Schedule.  There are 2 Release Schedules...one for Form 1 (Planned) and one for Form 2 (Authored).  When the user selects the button for form 2, i want my "Helper for Conditional Dropdown" field to say Authored.  If they pick the button for Form 1, that would tell my "Helper for Conditional Dropdown" field to say Planned.  Authored and Planned = [TC Type] in my Release Schedule table and are the triggers i have used in my conditional values area in my Related Field.  My proxy is "Helper for Conditional Dropdown".  

I dont want the user to have to select Planned or Authored, i want it determined automatically based on which form they select.  :smile:  

I hope that made better sense?
If the goal is to push a button and prepopilate a field on the child record with a value, then I previously gave you examples of code to add into your formula.

It was where I was using examples to populate field IDs 50, 51, 52.

I'm  just on my iPhone now so I can't copy that down to this post.
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
Yeah, I think so.  Mind dumbing down that formula you wrote for me a little more?  Fid 7 is my Related App Team, so i get that one.  What triggers the Authored vs. Planned aspect? :-/

URLRoot() & "db/" & [_DBID_PLANNED_TEST_CASES] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])
& "&_fid_50=" & totext([some numeric field])
& "&_fid_51=" & URLENCODE([some text field that might have spaces or special characters])
& "&_fid_52=1" // make a checkbox field true
& "&_fid_53=0" // make a checkbox field false
& "&z=" & Rurl()& "&dfid=10"
Can you tell me what the field ID number is that holds the text multiple choice field for a Authored / Planned?
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
oddly enough...fid 52.
Wow, 52, that is a coincidence.


URLRoot() & "db/" & [_DBID_PLANNED_TEST_CASES] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])
& "&_fid_52=Planned"
& "&z=" & Rurl()

URLRoot() & "db/" & [_DBID_PLANNED_TEST_CASES] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode ([Record ID#])
& "&_fid_52=Authored"
& "&z=" & Rurl()& "&dfid=10"
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
Worked like a charm!!  On each form, i just made that field read only and might even hide it.  Slowly but surely I am understanding some of the code giberish!  LOL  Thanks Mark.
OK, I saw a small flash of light.  It might have been the light bulb in your head turning on!

Yes, so there URL formulas are URLs.  URL do not have spaces in the or special characters.  So in your case,
this worked
& "&_fid_52=Authored"

But if you had to stuff in a different value which had spaces then you would need to URLEncode

like

& "&_fid_52=" & URLEncode("Authored by Jana")
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
ok! :smile: Yep, think it is a light bulb.  Wish i could download your brain.  My app would be pretty amazing!
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
Ut-oh Mark...i'm not out of the woods yet.  I am successfully entering data on my 2 forms via my buttons, however, on the main report page in the Planned TC Table where the rows of data are listed...when i click that record to view it, it takes me back to the primary form fid 2 vs. the form i entered the data in???  I dont get that?  How do i fix this issue?
Well, you may not like this answer.

The form which gets used when a record is displayed is the default form -which is your form ID #2.  The only way to make that different is that you can specify a form to be used by report.

My suggestion is that you have just 1 form and then use form Rules based on that Planned or Authored field to show/hide fields or sections accordingly.
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
Well crap!  LOL  When creating a report, where does it ask what form you want to use other than the default?

Ok, good suggestion, but holy waist of my time today building those extra forms! LOL  #%@#@$

So to make sure i get your drift, use the buttons as programmed, that will trigger the form rules to hide the section i dont want the user to see.  If the user chooses the Planned button, the form rule would hide the Authored section and vice versa.  Correct?
Exactly.  Use form Rules based on that field.  I suggest as much as possible that you show/hide sections and not fields because there are going to be lots of fields and the layout may have problems if you suddenly hide a field that was purposely dropping to a new line.

Also, note that you cannot have an input field appear twice on a form - even if its in a hidden section.  That is because if you input twice into the same field, it will confuse the app as to which input to believe.  The form mostly prevents you form making that mistake.
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
ok.....good times!  Lets hope for no more road blocks or speed bumps! Thanks again! :+1:
Well, it gets easier.  There is a finite set of knowledge for QuickBase and you will get there.  I've been at QuickBase since 2002, so believe me I have seen every dead end and syntax error you can imagine. It does get easier, but you either just need to learn by doing, or else take a course - I do training too.  

Did I point you to this app I put in the in the Exchange?

URL Formula Buttons for Dummies v1
https://yqc.quickbase.com/db/main?a=AppDetail&ID=1803&app_name=URL%20Formula%20Buttons%20for%20Dummies%20v1

There is good info there as to how to build URL formula buttons.
Photo of Jana

Jana

  • 324 Points 250 badge 2x thumb
Great. Thank you! :smile: