I am trying to create a new entry into podio via the API I can set text type fields and date type fields but I cannot seem to sort out how to set a category type field. The example for .NET shows setting the OptionId = x where x is a int value of the category field. But what if I do not know that Id value. I have a string value from my DB that matches the text value found in the category (dropdown style) field but not sure I can use that to set it?
This example doesn't work b/c it has no values in option.
var typeCategory_ModuleStr = podioNewItem.Field("module");
IEnumerable<CategoryItemField.Option> categories = typeCategory_ModuleStr.Options;
List<CategoryItemField.Option> moduleOptions = categories.ToList();
foreach (CategoryItemField.Option option in moduleOptions)
{
if (option.Text == tableRow["MODULE"].ToString())
{
typeCategory_ModuleStr.OptionId = Convert.ToInt32(option.Id);
}
}
You can find the option ids for a category in your app by using the sandbox at the bottom of this page: https://developers.podio.com/doc/applications/get-app-22349
Or you can match the text value to the option id by something like this (PHP):