Update Sharepoint KPI List Goal and Threshold Value Programatically

There may come a requirement where you have to update your sharepoint KPI’s Goal value and threshold value programatically or by taking values from some 0ther list . Here is a sample scenario where you can see the values from one sharepoint list is taken and updated in another kpi list .

public class ValueHandler:SPItemEventReceiver
StreamWriter sw;
public override void ItemUpdated(SPItemEventProperties properties)
void GenerateID(SPItemEventProperties properties)

/// execute instrns

SPSite Site = new SPSite(properties.WebUrl.ToString());

SPWeb Web = Site.OpenWeb();

Web.AllowUnsafeUpdates = true;

SPListItem item = properties.ListItem;

SPList listKPI = Web.GetList(“/Lists/listname”);

SPListItem listitemkpiSub = listKPI.Items[0];

SPListItem listitemkpiInt = listKPI.Items[1];

SPListItem listitemkpiPlac = listKPI.Items[2];

listitemkpiSub[“Goal”] = properties.ListItem[“GreenSubmission”].ToString();

listitemkpiSub[“Warning”] = ¬†properties.ListItem[“YellowSubmission”].ToString();




catch (Exception ex)


properties.ErrorMessage = ex.Message; }


{   this.sw.Dispose();



Here i have used an event receiver for a list item where in when an item here gets changed then the custom kpi’s list goal and threshold value will get changed.

ping back if you have any queries

Leave a Reply

Your email address will not be published. Required fields are marked *