Making variable editor editable based on state to opened by user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 08:04 PM
I want variable editor editable for CSM module in portal by "opened by" user in "draft" state.
When I create case via RP , after submit, it create case in "draft" state.
I want every variables to be shown and editable in portal for user. currently only comments is visible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 08:51 PM
that's the OOB behavior. End users who submit request are not allowed to edit the variables post submission
what's your business requirement?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 09:08 PM
Hi @Hafsa1 ,
You need to modify the main widget and add then "sp-variable-editor" widget in it. put condition like state is draft then execute else execute the OOB one.
Once you add sp-variable-editor your all fields will become editable.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 09:10 PM
we have created a state "draft" in case table. And had a flow for approve, reject and more info required.
Agent can update the case with "more info required" button which will update case to "draft" state and in this state we want all variables to be editable in portal.
I have added widget "sp-variable-editor" in the portal page and can see all variables now. But that is in editable format. I want editable only in "draft" state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2024 09:19 PM
Hi @Hafsa1 ,
As i said you have to put logic to make it editable only if state is Draft.
Try below.
<sp-variable-editor readonly="{{isReadOnly}}"></sp-variable-editor>
In client script
$scope.isReadOnly = ($scope.data.state !== 'draft'); // Editable only if in "draft"
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------