Capturing value from widget into a project field

rdskn023ET
Tera Contributor

Currently, we have a widget built that displays the key risks, actions and decisions for a single project on a page. What our corporate staff would like to see is a report of all projects with those key risks, actions and decisions listed on that report. We do not use RIDAC, so we can't access any of that data, but wanted to see if anyone has set something up where they created a project field and captured the key risks within that field so they could be displayed on a report for that project. Obviously, the same would hold true for the actions and decisions. 

Being that the data is captured in a widget, wasn't sure if there was a way I could capture that data and import it into a project field directly for each project? This is not something I have attempted before, nor was I the one who created the widget, so wanted to reach out to see if anyone had done something like this before. 


Thanks in advance! 

1 REPLY 1

Thanks for your reply!

 

I have a couple of additional questions. I will check out your site to see what additional information is provided there. 

First, regarding your sample code. I broke it down for just the Risks to begin with. 

var widgetData = current.widget.getDisplayValue();

current.key_risks = widgetData.key_risks;

 

Under current.widget.getDisplayValue();, I assume I would need to specify the widget name there, If so, how does the code know to pull just the risk information from from the large amount of code that has been put into the widget for other items? Is widgetData.key_risks; how it is distinguishing that, as you were just using a generic sample name, I assume and I would need to find the field name they used in their coding? Sorry, again, I am not the one who created the widget or coded it, so just trying to find a way to get the data out, as this is new to me. Again, appreciate your help!

 

If this helps, in the server script of widget, here is how the risks are referenced:

    data.risks = JSON.parse(new PoPUtils().getRisks(data.project,data.date));
    if(data.risks.length > 0){
        data.showRisks = true;
    }

 

If pulling this information from a widget is not the best approach to get this type of information, do you have any other suggestions to capture it?

 

Thanks!