Post

1 follower Follow
0
Avatar

Getting a Field input (toggle) to trigger a custom action.

I have toggle field that when set to "true"enables a custom action which prompts the user to fill out a couple of text fields.  The API then populates other fields with this info.

I would like to find a way to have the custom action auto triggered by the toggle  instead of the user having to run the action manually.  The way it is now, there is a possibility to to have the toggle set to "true" and no data submitted until they run the custom action.

Mike Moore Answered

Please sign in to leave a comment.

5 comments

0
Avatar

There is currently no way to trigger a custom action. Perhaps there is a way around your scenario of having the toggle set to true and no data being submitted. Would making the fields in the custom action mandatory prevent this situation?

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

I have it set to mandatory already with a default value of "Not Required".  The problem is that if you run the custom action a second time and enter "Not Required"  you can end up with the toggle set to true with the default value showing.

I have tried to make a work rule to test if the toggle is true AND the default value is "Not Required" to reset the toggle to false, but all it does switch the toggle back when I try to change it.

Being able to auto trigger actions would be a great feature.

Mike Moore 0 votes
Comment actions Permalink
0
Avatar

Can you walk through the full scenario in detail? If it is a required field, I'm not sure why there would be a default value of not required. Ideally the default value would just be null that (empty) so that the user is required to put something in for the custom action to successfully run.

Josh Santos 0 votes
Comment actions Permalink
0
Avatar

Sure.

There are three parts to this puzzle:

  • A trigger field (toggle)
  • A custom action (enabled by the toggle)
  • A read only field that is updated by the API using results from the custom action.  A default value of "Not Required" is shown unless otherwise updated by the API (user changes it via the custom action).

Synopsis:

To check if an Engineer's certificate will be needed for this project and if so, prompt the user for the name or firm of the Engineer.

Problem:

If a user toggles the action , runs it ,and inputs text in the name field, the read only field is updated via the API showing the Engineer to use in the project header.  If a user runs the custom action a second time and enters "Not Required" as the Engineer Name,  You wind up with the toggle field on and "Not Required" as the Engineer name.

I have tried to run a work time rule that checks for:

$C_Eng_Name="Not Required"

&&

$C_Req_Eng_Seal=TRUE

and if true sets the $C_Req_Eng_Seal field (a toggle field) back to false.  This results in the API switching the field back as soon as you switch it on and the custom action never getting to run.

Thanks!

 

Mike Moore 0 votes
Comment actions Permalink
0
Avatar

Okay, I'm still not sure why a toggle is even required in this scenario.  Why not just have a custom field for the Eng Name, and if the name is changed it will update the project name?  You could also make it so that at the end of the custom action it will reset the toggle.

Josh Santos 0 votes
Comment actions Permalink