Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to Get value (text) from Calculated column in SharePoint online/O365 using client object model.

$
0
0

I have searched a lot and got some solutions but end up with getting only formula. Like:

                                    var fld = l2.Fields.GetByInternalNameOrTitle("Months"); //Months is a calculated field
                                    var fldCalc = new FieldCalculated(clientContext2, fld.Path);
                                    clientContext2.Load(fld, f => f.SchemaXml);
                                    clientContext2.Load(fldCalc);
                                    clientContext2.ExecuteQuery();
                                    Console.WriteLine(fldCalc.Formula);

I have also seen the solution for server side like:

SPFieldCalculated cf =(SPFieldCalculated)myItem.Fields["Months"];string value = cf.GetFieldValueForEdit(myItem["Months"]);

But not able to find the solution/value that i need!! Please help.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>