question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Copy Value with Trigger

See original GitHub issue

Is it possible to copy the value from one question to another via a trigger? For example:

{
 pages: [
  {
   name: "page1",
   elements: [
    {
     type: "text",
     name: "homephone",
     title: "Home Phone",
     isRequired: true,
     inputType: "tel"
    },
    {
     type: "boolean",
     name: "sameashomebool",
     defaultValue: "True",
     valueTrue: "True",
     valueFalse: "False"
    },
    {
     type: "text",
     name: "mobilephone",
     visibleIf: "{sameashome} empty",
     title: "Mobile Phone"
    }
   ]
  }
 ],
 triggers: [
  {
   type: "setvalue",
   operator: "equal",
   value: "True",
   name: "sameashomebool",
   setToName: "mobilephone",
   setValue: "homephone"
  },
  {
   type: "setvalue",
   operator: "equal",
   value: "False",
   name: "sameashomebool",
   setToName: "{mobilephone}"
  }
 ],
 showQuestionNumbers: "off",
 showProgressBar: "top"
}

What is the current behavior?

The above snippet copies the literal {mobilephone} string. I was hoping to copy the value entered by the user.

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewtelnovcommented, Jul 16, 2018

@wollerman @akhoury I have added CopyValueTrigger. It has setToName and fromName properties.

Thank you, Andrew

1reaction
andrewtelnovcommented, Jul 13, 2018

@akhoury Unfortunately not, but I will increase the value of the card in the TODO list.

Thank you, Andrew

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to copy values between fields using triggers
I'm currently trying to create a trigger to copy a custom text field on a ticket into a custom user field.
Read more >
Mysql trigger to copy id from one column to another in same ...
So my question are: With this trigger value in both column will be always same when new record is created? Is there better...
Read more >
Apex trigger to copy a value from a custom field to a standard ...
I have an idea, but am not sure how to accomplish it using an Apex trigger... ... Step #1: Enter the lead's first...
Read more >
Examples of copying triggers - IBM
These examples show the DDL that is generated when you copy triggers between heterogeneous databases. The triggers are copied as part of the...
Read more >
Given a FOR EACH ROW trigger that runs on INSERT, will ...
Out of curiosity, I tested it myself. It seems like COPY is materially faster than multi-value INSERT when it comes to triggers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found