Show a text field when a list collector no matches found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I have variable, that is type list_collector on the alm_asset table. Should the list_collector return 'no matches found' I want to display and un-hide a single line text field. How would do that?
In my list_collector, I have a reference qualifier applied 'javascript: new AssetReclamationUtil().getRefQual(current.variables.requested_for, current.variables.requested_by);'
Variable attributes: glide_list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello @athavichith ,
Whenever the user will not have the proper role to see the values in my reference table the 'no matches found' will automatically return..
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
56m ago
that's not the case. maybe all the assets have been reclaimed and they are no assets tied to user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @athavichith ,
simple approach would be to hide the single line text field until some value is selected on the list collector.
you can create a catalog ui policy or onChange client script on the list collector variable and hide the variable until some value is selected.
other approach
is to use the client script with GlideAjax to check if the user have the record access and the AssetReclamationUtil().getRefQual(current.variables.requested_for, current.variables.requested_by); is return is some records and based on that hide the single line text field
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
So if I understand correctly, you are wanting another field to show up if the user will not be able to pick a value in the glide_list field you created. Correct?
Options I can think of off the top of my head are
1 - Have an on display BR run to query for the same data using the same filter and if no records are returned then set a client value that an onLoad client script will check and hide or show the field as needed.
2 - Do the same as 1 but instead of using an on display BR use the onLoad client script to make a web call back to the server to get the information and then hide or display the field as needed.
