Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeric 122 posts 192 karma points
    Oct 18, 2013 @ 14:58
    Jeric
    0

    Getting contour dropdownlist selected text instead of value field

    I'm creating a workflow for my contour form and I need to check if there is any way to get the 

     

    Eg my dropdown list html codes. I need to get the text shown on the screen (as in 1-19, 20-39, 40-59, etc) instead of the "value" field which is a string of weird characters.

    <select name="9cef010f-8e70-4171-bb88-d96b30be5100" id="9cef010f-8e70-4171-bb88-d96b30be5100" data-val="true" data-val-required="How many people took park? is mandatory">
        <option value=""></option>
            <option value="afc49185-e93a-4039-898e-6c8e7b6394bf">1 - 19</option>
            <option value="39c3d378-8a78-4db2-9b9e-1fcc96233c06">20 - 39</option>
            <option value="b6c45cbe-8fb1-492e-abfa-4d159ca01655">40 - 59</option>
            <option value="a8a29cca-8cdf-4d3e-b274-de6381092a63">60 - 79</option>
            <option value="6b814a71-b4ca-4452-a945-c2f909113018">More than 80</option>
    </select>

     

    My workflow bit that i'm unsure

    public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
    {
        foreach (var rf in record.RecordFields.Values)
        {
            if(rf.Field.Caption == "How many people took park?")
            {
                // this only get's the strange value from the dropdown. How do I get the text that i want?
                var totalPeople = rf.Values[0].ToString();
            }

     

    So, the part on:

    var totalPeople = rf.Values[0].ToString();

    only get's me the weird "value" with strange characters. How do I get the text shown?

    Thanks


  • Comment author was deleted

    Oct 21, 2013 @ 09:57

    Just update the value on your view ... to use the text and not id that is the easiest solution

  • Vasia Vasia 49 posts 241 karma points
    Nov 26, 2013 @ 17:34
    Vasia Vasia
    0

    Hi Tim,

    If I should have separate text/value for a dropdown - how can I get text in my custom workflow?

    Thanks,Oleg

Please Sign in or register to post replies

Write your reply to:

Draft