You are viewing limited content. For full access, please sign in.

Question

Question

Dynamic Radio option in Modern Form Designer

asked on December 30, 2025

I have a radio button field named AsanaBoardQuestion (Question: Does this project have an Asana Board?) with options for "Yes" or "No". In addition, I have several other Radio button fields on which one of the options references that Asana Question. If the answer to the AsanaBoardQuestion is "no", I want to hide the corresponding option on all the other radio button fields. For example, the other radio button fields are required documentation fields, and they each have an option called "Already in Asana". If the project does not have an Asana board, I don't want to present the option on those fields that says "Already in Asana".

I am using the Modern form designer. Is there a way to set a rule to hide individual radio button options? Or is there a way in Javascript using the LFForms object to do this?

0 0

Replies

replied on December 30, 2025

I think the easiest way to do what you are looking to do is to have 2 field (1 with the Asana option and 1 without it).  Then use a field rule to show 1 and hide the other when the AsanaBoardQuestion is No.

0 0
replied on December 30, 2025 Show version history

Thanks Bert. I figured out a way to do it using the LFForm object...

  • AsanaBoardQuestion is the Yes/No field on which my condition is based
  • The calls to the setArtifactOptions function each contain the variable name of the radio button fields that I am dynamically setting.
    • If AsanaBoardQuestion == "No", then I remove the JIRA option
    • If AsanaBoardQuestion does not Equal "No", then I re-create all of the valid options for that field. The reason that I'm re-creating all of them rather than just "Adding" back in the option that I want is because I couldn't figure out how to add that option at the correct index. Using just the "add" option for LFForm.changeFieldOptions function just adds that option at the end, and I didn't like the way that looked.
function setArtifactOptions(varName) {
  var asanaValue = LFForm.getFieldValues({variableName:"AsanaBoardQuestion"});

  if (asanaValue.value == "No") {
    // Do something
    LFForm.changeFieldOptions( { variableName: varName }, ["Already in JIRA"], "remove" );
  } else {
    LFForm.changeFieldOptions( { variableName: varName }, ["Upload Link Needed","Already in Connectwise","Already in Client Folder","Already in JIRA","Do Not Have - See Comments for Explanation"], "replace" );
  }
}

function checkAsanaValue() {
  setArtifactOptions("Kickoff_Deck");
  setArtifactOptions("Meeting_Notes");
  setArtifactOptions("Software_Deployment_Plan_Matrix");
  setArtifactOptions("Testing_Notes");
  setArtifactOptions("Acceptance_Criteria");
  setArtifactOptions("Training_Notes___Agenda");
  setArtifactOptions("Project_Closeout_Deck");
}

LFForm.onFieldChange(() => 
    checkAsanaValue()
    , {variableName: "AsanaBoardQuestion"});

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.