How can we add fields for Change requests under my active items widget

zeerodger27
Tera Contributor

Hello,

 

Can we add the additional fields in My active items widget?

 

For example: in change request I want to display Configuration Item, category, sub category, Description - to view all the information related to the request on the same page. 

 

padduk_1-1712140518133.png

In Highlighted space can we add Description,.. fields

3 REPLIES 3

Isaac Vicentini
Mega Sage
Mega Sage

Hi,

To customize this page, you need to access the following module: To-dos Configuration.

IsaacVicentini_0-1712148953357.png



Considering you need to alter an approval page that is in the "Open" tab, you should access the following record:

IsaacVicentini_1-1712149088233.png


In the related list "To-dos Widget Mapping," the relationship of which widget will appear on the approval page is established. What determines which page will appear is the condition contained in the "Condition" field.

IsaacVicentini_2-1712149382663.png

 

You can see that there are records with different conditions; each condition displays the corresponding widget in the "Widget" field.

What you should do is create a record in this related list with the condition being: Source table is change_request and in the Widget field, a clone of the "Todos Approval" Widget.

The clone of this widget should be analyzed and customized according to your needs.
Doing this can be complicated at first, but let me know if you have any questions, and I can help you.


If my answer helped you in any way, please mark it as correct/helpful 🙂

Regards,

Isaac Vicentini.




Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.

Hi @Isaac Vicentini,

 

Thanks for the help and it is very helpful for me. 

 

Could you please help me for the below issue

 

I have modified the server script as below

(function() {
    var REQUESTED_STATE = "requested";
 
    if (options && options.sysId) {
        data.approvalId = options.sysId;
        getApprovalInfo(data.approvalId);
        options.useCommentBox = true;
        data.approvalActionsWidget = $sp.getWidget("todo-approval-actions", options);
   }
 
    //This function gets ShortDescription of the parent case.
    function getApprovalInfo(sysId) {
        var sysApprovalRecord = new GlideRecordSecure('sysapproval_approver');
        data.shortDescription = "";
data.des = "";
        data.categry = "";
        data.subCategory = "";
        if (sysApprovalRecord.get(sysId)) {
            data.isPosted = false;
            if (sysApprovalRecord.state.toString() !== REQUESTED_STATE)
                data.isPosted = true;
if (!gs.nil(sysApprovalRecord.sysapproval.description))
                data.des = sysApprovalRecord.sysapproval.description;
            
            if (!gs.nil(sysApprovalRecord.sysapproval.category))
                data.categry = sysApprovalRecord.sysapproval.category;
            
            if (!gs.nil(sysApprovalRecord.sysapproval.subcategory))
                data.subCategory = sysApprovalRecord.sysapproval.subcategory;
            if (!gs.nil(sysApprovalRecord.sysapproval) && !gs.nil(sysApprovalRecord.sysapproval.short_description))
                data.shortDescription = sysApprovalRecord.sysapproval.short_description;
            else if (!gs.nil(sysApprovalRecord.document_id))
                data.shortDescription = !gs.nil(sysApprovalRecord.document_id.short_description) ? (sysApprovalRecord.document_id.number + " - "+ sysApprovalRecord.document_id.short_description) : sysApprovalRecord.document_id.number;
            else
                data.shortDescription = !gs.nil(sysApprovalRecord.sysapproval) ? sysApprovalRecord.sysapproval.number: "";
        data.approvalText = gs.getMessage("Do you want to approve the following:\nShort Description: " + data.shortDescription + "\nDescription: " + data.des + "\nCategory: " + data.categry);
        } else
            gs.addErrorMessage(gs.getMessage("Unexpected action occurred"));
        return sysApprovalRecord;
   }
 
})();


and I'm getting an output in continuous line as below

 

padduk_0-1712750327967.png


Any idea how to get that in new lines

Instead of breaking the line on the server-side with "\n", try performing the line break in HTML with "<br>".

Identify in your HTML where the variable {{data.approvalText}} is used, replace it with something like:

 

<p>Do you want to approve the following:</p><br>
<p>Short Description: {{data.shortDescription}}</p><br>
<p>Description: {{data.description}}</p><br>
<p>Category: {{data.category}} </p><br>

 

 

The code above is just an example. See the best way to do this in your HTML.


If my previous solution helped you customize the Change approval page, please mark it as correct or helpful so it can assist others as well. 🙂

Regards,

Isaac Vicentini


Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.