Argument or Script Include?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 07:05 AM
Hello Folks,
I'm new to development on the now platform, in some modules an argument was placed:

Sorry, company policy
So, logically, the following argument was assembled:
(situacaoIN6,9^prefixo=9909) or (situacaoIN7,10^prefixo_super=9909) or (situacaoIN8,11)
Is there any way to assemble an argument to put in the module? Or will I have to make an include script and access it from the module
Thank you for your attention
- Labels:
-
Scripting and Coding
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 07:13 AM
I don't think you can assemble something directly from the module. I've always used either script include or direct JS as an argument . Example :
fn_preferences.do?sysparm_query=sys_id=javascript:var gr = new GlideRecord('fn_preferences');gr.query();gr.next();answer=gr.getUniqueValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 07:13 AM
What exactly you want to achieve?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2022 08:57 AM
Hello,
Interesting sir, but I found an answer in the link below:
I wanted to set up a complex query, which consisted of filtering three groups that already have their complexity
Thanks for the effort 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2022 12:46 PM
Hey,
You can sure use complex code in the Arguments field if it supports Javascript, but I would heavily recommend creating a Script Include instead. It's much easier to read, debug and maintain than a one-line monstrosity without any code highlighting.
On the other hand, if your argument is simply an encoded query that doesn't require any dynamic data that can only be gathered by code, you can simply build the condition in the table list view and then right-click the Filter breadcrumbs -> Copy query, and use that query in that Arguments field.