Filter CategoryItemField By Description #.NETAPI
AnsweredHi,
Regarding the NET API component CategoryItemField
Is there any method I pass the description of a category and it returns the OptionId ?
-
Hi Ajmal,
Thank you!
I Implemented your code and hitherto returns perfectly
var key = podioApp.Config.Settings["options"]
But the complete code returns the Error.look:
podioApp.Config.Settings["options"] {[
{
"status": "active",
"text": "Text A ",
"id": 1,
"color": "FFD5C2"
},
{
"status": "active",
"text": "Text B”,
"id": 5,
"color": "E1D8ED"
},
{
"status": "deleted",
"text": " Text C”,
"id": 2,
"color": "E1D8ED"
},
{
"status": "deleted",
"text": "Text D",
"id": 3,
"color": "DCEBD8"
},
{
"status": "active",
"text": "Text E",
"id": 4,
"color": "FFD5C2"
},
{
"status": "deleted",
"text": "Text F",
"id": 6,
"color": "DCEBD8"
},
{
"status": "active",
"text": "Text G",
"id": 7,
"color": "F7F0C5"
}
]} Newtonsoft.Json.Linq.JToken {Newtonsoft.Json.Linq.JArray}But the complete code returns the Error Following
podioApp.Config.Settings["options"].FirstOrDefault(x => (string)x["text"] == categoryText)["id"].ToString() Expression cannot contain lambda expressions -
podioApp.Config.Settings property is a JObject. You can easily query the date with LINQ, Please refer this documentation: http://www.newtonsoft.com/json/help/html/QueryingLINQtoJSON.htm
Please sign in to leave a comment.
Comments
4 comments