Dynamic content to use the selection from another dynamic content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2023 07:01 AM
Hi,
I have 2 dynamic contents acting as interactive filters on a dashboard.
Is it possible to make one of dynamic contents react to/use a value chosen in the other dynamic content on the same dashboard?
The one dynamic content item creates a drop-down list of users based on some criteria.
This dynamic content widget is already used on various dashboards and ideally, I'd like to leave it as it is as much as possible.
On this dashboard, however, if the user chooses a name from the list, then I'd like a second dynamic content widget to my dashboard, which uses the value chosen in widget 1.
Dynamic content 1/Users shows
- John Doe
- Mary Manager
- Thomas Tank
If the user selects Mary Manager, then I'd like the second dynamic content to show all entries from a custom table (project phase) of ours where Mary is the manager.
Initially the reports should show all info from all of "Mary's" projects, but the current user could further limit it by choosing "Project ABC", then reports will show only that project.
So I want my 2nd dynamic content to kind of be:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_customer" object="true" jelly="true">
var proj = [];
var gr = new GlideRecord("u_project_phase");
gr.addQuery('u_projmgr', <***Insert Mary's sys_id here from other DC***>);
gr.query();
while (gr.next()){
var obj = {};
obj.value = gr.sys_id+'';
obj.name = gr.name+'';
proj.push(obj);
}
}
proj;
</g:evaluate>
....
I need that sys_id from the other content. Is this possible?
Or is there another/better way of achieving the same thing? My jelly knowledge etc is quite limited so I'm battling to get anything to work e.g. code both drop-downs in a single dynamic content??
Thanks,
Valerie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2023 01:36 PM
In your dinamyc content can add a script tag, in a function you can try to get the value before saved into a hidden input by "gel('id').value"