- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2017 12:04 PM
Hi there,
I ´m trying to get the request number generated and use it in a onLoad script, and if the request number ends with pair number,
a field called "Service Provider(single text)" that I've created will be auto populated with a string value(Name of the provider) or if the condition
is false(request number ends with odd number) the field "Service provider" will be auto-populated with another provider name.
This functionality is because the user needs that the service provider appears in the report, and there are two providers, hence the request ending
with odd number triggers the emails to one provider and the ones ending with a pair number go to the other provider.
Thanks in advance, appreciate any help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2017 10:20 PM
Hi Jorge,
Please add a run script block like below in Workflow
Inside Run script block use the below script:
var reqNum = current.request.number;
var array = reqNum.toLowerCase().split('');
arrLength = array.length;
var str = reqNum.substr(array.length-1, array.length);
if (str=='0'||str=='2'||str == '4'||str == '6'||str == '8'){
current.variables.provider = 'Movil Ride';
}
else current.variables.provider = 'Movil Ex';
Thanks,
Arindam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2017 10:20 PM
Hi Jorge,
Please add a run script block like below in Workflow
Inside Run script block use the below script:
var reqNum = current.request.number;
var array = reqNum.toLowerCase().split('');
arrLength = array.length;
var str = reqNum.substr(array.length-1, array.length);
if (str=='0'||str=='2'||str == '4'||str == '6'||str == '8'){
current.variables.provider = 'Movil Ride';
}
else current.variables.provider = 'Movil Ex';
Thanks,
Arindam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 09:48 AM
Hi Arindam,
Awesome, this time it works perfectly, thanks for your help and support
Best Regards
Jorge Glez