
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 01:12 AM
Please can anyone advise what the correct syntax should be to acheive the following in a create task description field using flow.
Requested for: u_requested_for
Contact details: contact_variable
Have scripted the following and tried several variations - both insert correctly on their own but as soon as I try and join them it fails)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 01:48 AM - edited 08-01-2024 01:50 AM
hi @Cirrus ,
can you try something like this
var requestedFor = fd_data.trigger.request_item.variables.request_for;
var contactDetails = fd_data.trigger.request_item.variables.short_description;
var details= 'Requested for: ' + requestedFor + '\n' +
'Contact details: ' + contactDetails;
return details;
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 01:17 AM
hi @Cirrus
To concatenate strings in a Flow Designer script for creating a task description field in ServiceNow, you need to ensure that you correctly reference the variables and format the string properly. Below is the corrected syntax:
return '\n' +
'Requested for: ' + fd_data._1_get_catalog_variables.u_requested_for.getDisplayValue() + '\n' +
'Contact details: ' + fd_data._1_get_catalog_variables.req_contact.getDisplayValue();
This should work within the Flow Designer in ServiceNow, combining both fields into the task description. Ensure that the variable names (u_requested_for and req_contact) match exactly with what you have defined in your catalog variables.
i hope my answer helps you to resolve your issue if yes, mark my answer correct & helpful
THANK YOU
rajesh chopade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 01:34 AM
Hi @Cirrus
Modify your code as bellow and try once again:
return '\n' +
'Requested for: ' + fd_data._1_get_catalog_variables.u_requested_for.getDisplayValue() + '\n' +
'Contact details: ' + fd_data._1_get_catalog_variables.req_contact.getDisplayValue();
I hope my answer helps you to resolve your issue if yes, mark my answer helpful & correct.
THANK YOU
rajesh chopade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 01:48 AM - edited 08-01-2024 01:50 AM
hi @Cirrus ,
can you try something like this
var requestedFor = fd_data.trigger.request_item.variables.request_for;
var contactDetails = fd_data.trigger.request_item.variables.short_description;
var details= 'Requested for: ' + requestedFor + '\n' +
'Contact details: ' + contactDetails;
return details;
Please mark helpful & correct answer if it's really worthy for you.
Thanks,
BK

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 04:43 AM
Thanks Bhavya, works a treat