PureConnect

Discussion Thread View
Expand all | Collapse all

Structured Parameters

Jump to Best Answer
  • 1.  Structured Parameters

    NEW MEMBER
    Posted 05-11-2021 11:48
    Edited by Joe Parker 05-12-2021 15:30
    Good morning.  I'm pretty new to the sdk, but have a task which requires I set the value for a given structured parameter through a job.  I've thus far been able to successfully query for and load the parameter in question.  I see the configuration object that contains it has a 'PreparForEdit' method exposed, but the StandardProperties.Value property is ReadOnly.  I've not yet been able to find in the documentation how to set these, and was wondering if anyone had any experience in this regard.  I'm using ICELib in this task.

    My question is, is it possible to set values on a StructuredParameter, or should I look for another solution the the problem I'm trying to solve?

    Thank you in advance.
    #Integrations

    ------------------------------
    Joseph Parker
    Midway USA
    ------------------------------


  • 2.  RE: Structured Parameters

    GENESYS
    Posted 05-11-2021 12:52
    Hi Joseph,

    Can you clarify whether you are using ICWS or ICELib to access? This will help the appropriate collection of experts pitch in ;-)

    ------------------------------
    Paul Simpson
    Senior Technical Instructor
    ------------------------------



  • 3.  RE: Structured Parameters

    NEW MEMBER
    Posted 05-11-2021 14:48
    Hey Paul, absolutely.  I'm using ICELib.  Updating original post now.

    ------------------------------
    Joseph Parker
    Midway USA
    ------------------------------



  • 4.  RE: Structured Parameters
    Best Answer

    GENESYS
    Posted 05-13-2021 08:37

    You should be able to do something like this:


    var Configman = ConfigurationManager.GetInstance(session);
    var ConfigurationList = new StructuredParameterConfigurationList(Configman);
    var Query = new QuerySettings<StructuredParameterConfiguration, StructuredParameterConfiguration.Property>();
    Query.SetPropertiesToRetrieveToAll();
    ConfigurationList.StartWatching(query);
    var SPList = configurationList.GetConfigurationList();
    var StructureParameter = SPList.FirstOrDefault(sp => sp.ConfigurationId.DisplayName == "Test stuff");
    StructureParameter.PrepareForEdit();
    StandardProperties< StructuredParameterConfiguration, StructuredParameterConfiguration.Property> SP = StructureParameter.StandardProperties;
    SP.Notes.Value = "I'm a note";
    StructureParameter.Commit();



    ------------------------------
    Eric Berkshire
    ------------------------------



  • 5.  RE: Structured Parameters

    NEW MEMBER
    Posted 05-13-2021 09:20
    Hey Eric,

    Thank you for the response!  I'm actually targeting the StructuredParameterConfiguration.Parameters.Value member.  While I can't set the value, I can manipulate the collection by clearing it and re-adding the values I need, and then committing the changes.  So, this will work, but if anyone has a more eloquent way I'm definitely all ears.

    Thank you again,
    Joe

    ------------------------------
    Joseph Parker
    Midway USA
    ------------------------------