Need to have the label displayed in a widget and not the value

PaulaaO
Mega Sage

Hi Developer Community,

I have cloned one of the widgets (Project Status Risks) from  Project Status Report portal page as I have been asked to customise it.

I managed to add the extra columns that I needed and get them displayed, however I am currently stuck as I don't know how to display the labels of a certain column choice, rather than their values - please see screen shots below.

find_real_file.png

find_real_file.png

From some other posts in Community I gathered that some additional scripting is needed within the widget, in the Body HTML template box I believe.

I barely have any coding skills, so would really appreciate some help with this.

Thank you.

Paula

1 ACCEPTED SOLUTION

As I was replying to your comment, whilst doing the screen shots, I realised the Choice List Specification was not the same for both fields and when I updated the one for Risk Baseline, the Status Report has reflected the label and not the value.

find_real_file.png

 

find_real_file.png

 

 

find_real_file.png

 

So, thank you for that šŸ™‚

 

Paula

View solution in original post

4 REPLIES 4

vkachineni
Kilo Sage
Kilo Sage

Paste your html and server script

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

<div class="panel panel-{{::c.options.color}} b">
  <div class="panel-heading">
    <div class="panel-title">${Risks}</div>
  </div>
  <div class="panel-body">
      <div class="row">
        <div class="col-md-12">
              <ul class="nav nav-tabs">
                <li ng-class="{'active': isPending == true}"><a href="" ng-click="setPending(true)">${Pending}</a></li>
                <li ng-class="{'active': isPending == false}"><a href="" ng-click="setPending(false)">${Completed}</a></li>
              </ul>
              <span ng-if="isPending" class="overflow-override">
                <sp-widget widget="data.pending_risks" />
              </span>
              <span ng-if="!isPending" class="overflow-override">
                <sp-widget widget="data.closed_risks" />
              </span>
        </div>
      </div>
  </div>
</div>

 

(function() {
	var taskQuery = "^task=" + $sp.getParameter('sysparm_sys_id');
	var tableName = 'risk';
	var reportBaselineId = new PmProjectStatusReport().getReportBaselineId($sp.getParameter('sysparm_report_id'));
	if(reportBaselineId) {
		taskQuery = "^parent=" + reportBaselineId;
		tableName = 'risk_baseline';
	}
		
		
  var p = {table: tableName, fields: 'short_description,risk_state,u_description,u_current_risk_score,u_proximity,u_mitigation_plan,assigned_to,due_date'};
  p.hide_header = true;
  p.hide_footer = true;
  p.filter = "^risk_stateIN-5,1,2" +taskQuery;
  data.pending_risks = $sp.getWidget('widget-data-table', p);
  p.filter = "^risk_stateNOT IN-5,1,2" + taskQuery;
  data.closed_risks = $sp.getWidget('widget-data-table', p);
})();

 

Thank you

Can you post the top portion of the dictionary screen of the u_proximity field.

Something like

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

As I was replying to your comment, whilst doing the screen shots, I realised the Choice List Specification was not the same for both fields and when I updated the one for Risk Baseline, the Status Report has reflected the label and not the value.

find_real_file.png

 

find_real_file.png

 

 

find_real_file.png

 

So, thank you for that šŸ™‚

 

Paula