I have the following code which returns me a value like this:


The value I am interested in its: empresa1

Is there anyway I can get it in an item adding event on a remote event receiver without string manipulation??

public static SPRemoteEventResult CreateClientSiteAndUpdateSiteOnList(SPRemoteEventProperties properties)
     SPRemoteEventResult result = new SPRemoteEventResult();
         using (ClientContext clientContext = TokenHelper.CreateRemoteEventReceiverClientContext(properties))
              if (clientContext != null)
                  var afterProperties = properties.ItemEventProperties.AfterProperties;
  • 1
    That format is fixed. So there is no problem with using String Manipulation. Jan 27 '15 at 23:18

You can try this

TaxonomyFieldValueCollection txColl = afterProperties["Nombre_x0020_Cliente"] as TaxonomyFieldValueCollection;
if (txColl != null) {
    foreach (TaxonomyFieldValue t in txColl) {
        if (t.Label != null)
  • its a remote event receiver, that doesnt work, TaxonomyFieldValueCollection is null Jan 27 '15 at 23:32
  • 1
    Ok if you try TaxonomyFieldValue t = afterProperties["Nombre_x0020_Cliente"] as TaxonomyFieldValue are you getting the object? Jan 27 '15 at 23:35
  • also null, check comment Jan 27 '15 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.