How to use autofil variable scripted to populate choice input field in mobile agent app?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 12:00 PM - edited 07-10-2024 12:01 PM
I am writing a script include and placing this into a variable to autofil an input field that is currently a choice field.
If the input field was a reference field, i would need my script include to return a JSON object like the following:
var obj={
"Value": value,
"DisplayValue": displayValue
}
But I am trying to find out what object to return for a choice input field. This is on the mobile agent app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 12:10 PM
Hi @zsquared,
For a choice input field in the mobile agent app, your Script Include should return the value directly as a string
Script Include:
var ChoiceFieldHelper = Class.create();
ChoiceFieldHelper.prototype = {
initialize: function() {},
getChoiceValue: function() {
var choiceValue = "your_choice_value"; // Replace with your logic
return choiceValue;
},
type: 'ChoiceFieldHelper'
};
Usage in a Client Script:
var choiceValue = new ChoiceFieldHelper().getChoiceValue();
g_form.setValue('your_choice_field_name', choiceValue);
Replace "your_choice_value" and 'your_choice_field_name' with your specific logic and field name. This will set the choice field value appropriately in the mobile agent app.
Thank you, please make helpful if you accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 01:52 PM
This is what I thought but it does not work.
Also, I don't see a place where I can put client scripts in the mobile agent app