I have a drop down with a number of values that have an ampersand in them and I am trying to match imported data with those drop down values.
The values are the same in the drop down and in my excel spreadsheet but whenever I import it always seems to add new values to the drop down instead of using existing ones.
I thought that this was happening because the values in umbraco get encoded so the & becomes & so I created a FieldAdapter to also encode the value being imported however it still doesn't seem to work.
This is the code of my parse function.
if (property.PropertyType.DataTypeDefinition.Text == "[site] Faculty Drop Down") { value = HttpContext.Current.Server.HtmlEncode(value.ToString()); } return value;
Think I know what is causing this. The CMSImport FieldAdapter will also kick in and that will convert the value instead of your FieldAdapter. Only one FieldAdapter will be executed. CMSImport V3 will address that. So think it's best to modify the datasource before upload. I find it weird that it's adding new records every time since that should not happen at all.
An alternative could be to not map the property and use the RecordImported event to assign the value. Check the manual for examples. Bit harder but would get the job done I think.
Hope modifying the datasource helps solving the issue.
Importing values into a dropdown
I have a drop down with a number of values that have an ampersand in them and I am trying to match imported data with those drop down values.
The values are the same in the drop down and in my excel spreadsheet but whenever I import it always seems to add new values to the drop down instead of using existing ones.
I thought that this was happening because the values in umbraco get encoded so the & becomes & so I created a FieldAdapter to also encode the value being imported however it still doesn't seem to work.
This is the code of my parse function.
Can anyone advise how I can solve this issue.
Hi suzy,
what happens if you just replace the character instead of htmlencode?
Thanks,
Richard
Same problem.
Hi Suzy,
Think I know what is causing this. The CMSImport FieldAdapter will also kick in and that will convert the value instead of your FieldAdapter. Only one FieldAdapter will be executed. CMSImport V3 will address that. So think it's best to modify the datasource before upload. I find it weird that it's adding new records every time since that should not happen at all.
An alternative could be to not map the property and use the RecordImported event to assign the value. Check the manual for examples. Bit harder but would get the job done I think.
Hope modifying the datasource helps solving the issue.
Cheers,
Richard
is working on a reply...