Skip to main content
New Participant
August 5, 2026
Question

Retrieve the text of the value selected from a dropdown located in a cell within a table

  • August 5, 2026
  • 10 replies
  • 61 views

So far, I've only been able to retrieve the values in a list:

[{“contractGoal”:“84”,“progress”:“0”,“dueDate”:“11/01/2026”,“participant”:“2”,“comment”:“ ”},{“contractGoal”:“91”,“progress”:“0”,‘dueDate’:" 10/10/2026“,”participant“:”1“,”comment“:” “},{”contractGoal“:”94“,”achievement“:”0“,”dueDate“:”20/09/2026“,”participant“:”1“,‘comment’:” "}]

 

ID 84 corresponds to some text. I would like to have the text in place of 84, and so on for all the lines.

10 replies

stefanhelzle0001
Brainy
August 5, 2026

Please explain this in more detail. I cannot follow ….

New Participant
August 6, 2026

 Thank you for your help.

 

I have a robot task where the robot needs to retrieve the contents of a table from an HTML page. The JSON result matches what I’m able to achieve by retrieving the first column using this CSS code:

“#Objectifs-” & sum(fv!index,-1) & “-code_objectif”

Here is the modified HTML code to include only the first column containing the dropdown.

<div class="dataTables_scroll">
<div class="dataTables_scrollHead" style="overflow: hidden; position: relative; border: 0px; width: 100%;">
<div class="dataTables_scrollHeadInner" style="box-sizing: content-box; width: 832px; padding-right: 0px;">
<table class="table table-bordered table-hover no-footer dataTable" role="grid"
aria-describedby="Objectifs_info" style="margin-left: 0px; width: 832px;">
<thead>
<tr role="row">
<th width="31%" style="text-align: center; width: 200px;" class="sorting_asc sorting_disabled"
tabindex="0" aria-controls="Objectifs" rowspan="1" colspan="1" aria-sort="ascending"
aria-label="Objectifs contrat: activate to sort column descending">Objectifs contrat
</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="dataTables_scrollBody"
style="position: relative; overflow: auto; width: 100%; max-height: 15em; height: 15em;">
<table id="Objectifs" class="table table-bordered table-hover no-footer dataTable" role="grid"
aria-describedby="Objectifs_info" style="position: absolute; top: 0px; left: 0px; width: 100%;">
<thead>
<tr role="row" style="height: 0px;">
<th width="31%"
style="text-align: center; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px; width: 200px;"
class="sorting_asc sorting_disabled" aria-controls="Objectifs" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="Objectifs contrat: activate to sort column descending">
<div class="dataTables_sizing" style="height:0;overflow:hidden;">Objectifs contrat</div>
</th>
</tr>
</thead>
<tbody>
<tr id="Objectifs-0" name="Objectifs-0" role="row" class="odd">
<td class=""><select class="form-control" id="Objectifs-0-code_objectif"
name="Objectifs-0-code_objectif" style="width: 100%;">
<option value="0">(Aucun)</option>
<option value="84" selected="selected">Agir sur ses difficultés administratives</option>
<option value="86">Agir sur ses difficultés d'hébergement</option>
<option value="88">Agir sur ses difficultés de logement</option>
<option value="85">Agir sur ses difficultés financières</option>
<option value="87">Agir sur ses difficultés juridiques</option>
<option value="89">Définir le projet de création/reprise d'entreprise</option>
<option value="91">Développer sa mobilité</option>
<option value="93">Développer ses capacités en lecture et écriture</option>
<option value="92">Développer son autonomie numérique</option>
<option value="90">Développer son entreprise</option>
<option value="94">Elaborer son projet professionnel et ou formation</option>
<option value="95">Engager une remobilisation socio-professionnelle</option>
<option value="96">Exercer une activité rémunérée et déclarée</option>
<option value="97">Prendre en compte son état de santé</option>
<option value="98">Surmonter ses contraintes familiales</option>
</select>
</td>
</tr>
</tbody>
</table>
<div style="position: relative; top: 0px; left: 0px; width: 1px; height: 210px;"></div>
</div>
</div>

 

mikes0011
Brainy
August 5, 2026

The “standard” approach here is to utilize the separate Dropdown properties of “choice labels” and “choice values”, where “labels” is set to the list of user-facing data that will make sense from the end user’s standpoint.

 

If your “goal” IDs (i.e. 84, 91, 94) correspond to values contained in another table - one traditional best practice would be to create a View that contains joins with the plaintext values from whatever table they’re in, then query the valid selection array on your interface, and use these on your dropdown.  If you’re merely trying to do it manually, however, you can always query those external values externally and show them on your form - at the end of the day you really just need to end up with 2 matching arrays you can supply to “choice values” (the IDs) and “choice labels” -- you just need to ensure they match in length and order. 

 

There are dozens of different possible styles in which to implement this, and they change subtly depending on what your exact specifications and requirements are.  As ​@stefanhelzle0001 noted already, you haven’t supplied us a lot of detail to work with here, so anything more you can provide would be helpful - screenshots, code snippets, what you’ve already tried and what’s gone wrong, etc.

The Expression Guru
New Participant
August 6, 2026

Thank you for your help.

 

I have a robot task where the robot needs to retrieve the contents of a table from an HTML page. The JSON result matches what I’m able to achieve by retrieving the first column using this CSS code:

“#Objectifs-” & sum(fv!index,-1) & “-code_objectif”

Here is the modified HTML code to include only the first column containing the dropdown.

<div class="dataTables_scroll">
<div class="dataTables_scrollHead" style="overflow: hidden; position: relative; border: 0px; width: 100%;">
<div class="dataTables_scrollHeadInner" style="box-sizing: content-box; width: 832px; padding-right: 0px;">
<table class="table table-bordered table-hover no-footer dataTable" role="grid"
aria-describedby="Objectifs_info" style="margin-left: 0px; width: 832px;">
<thead>
<tr role="row">
<th width="31%" style="text-align: center; width: 200px;" class="sorting_asc sorting_disabled"
tabindex="0" aria-controls="Objectifs" rowspan="1" colspan="1" aria-sort="ascending"
aria-label="Objectifs contrat: activate to sort column descending">Objectifs contrat
</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="dataTables_scrollBody"
style="position: relative; overflow: auto; width: 100%; max-height: 15em; height: 15em;">
<table id="Objectifs" class="table table-bordered table-hover no-footer dataTable" role="grid"
aria-describedby="Objectifs_info" style="position: absolute; top: 0px; left: 0px; width: 100%;">
<thead>
<tr role="row" style="height: 0px;">
<th width="31%"
style="text-align: center; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px; width: 200px;"
class="sorting_asc sorting_disabled" aria-controls="Objectifs" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="Objectifs contrat: activate to sort column descending">
<div class="dataTables_sizing" style="height:0;overflow:hidden;">Objectifs contrat</div>
</th>
</tr>
</thead>
<tbody>
<tr id="Objectifs-0" name="Objectifs-0" role="row" class="odd">
<td class=""><select class="form-control" id="Objectifs-0-code_objectif"
name="Objectifs-0-code_objectif" style="width: 100%;">
<option value="0">(Aucun)</option>
<option value="84" selected="selected">Agir sur ses difficultés administratives</option>
<option value="86">Agir sur ses difficultés d'hébergement</option>
<option value="88">Agir sur ses difficultés de logement</option>
<option value="85">Agir sur ses difficultés financières</option>
<option value="87">Agir sur ses difficultés juridiques</option>
<option value="89">Définir le projet de création/reprise d'entreprise</option>
<option value="91">Développer sa mobilité</option>
<option value="93">Développer ses capacités en lecture et écriture</option>
<option value="92">Développer son autonomie numérique</option>
<option value="90">Développer son entreprise</option>
<option value="94">Elaborer son projet professionnel et ou formation</option>
<option value="95">Engager une remobilisation socio-professionnelle</option>
<option value="96">Exercer une activité rémunérée et déclarée</option>
<option value="97">Prendre en compte son état de santé</option>
<option value="98">Surmonter ses contraintes familiales</option>
</select>
</td>
</tr>
</tbody>
</table>
<div style="position: relative; top: 0px; left: 0px; width: 1px; height: 210px;"></div>
</div>
</div>

 

mikes0011
Brainy
August 6, 2026

so… firstly, rows 1 - 34 in this snippet seem 100% irrelevant to the question, so i’m not clear why it’s pasted in its entirety, as opposed to the relevant snippet which seems to be lines 35/36 - 50.

Your robot / parsing algo should hopefully be able to transform the list of <option value=”XX”>YYYY</option> values into an id/label pair.  Your original snippet in the post seems to include the IDs but not the label values (i.e. the “YYYY” part).  You would then presumably want to use these IDs/Labels as your choice values / choice labels arrays in your dropdown.  If your aim is really something different from this, then once again i’m not sure you’ve provided enough detail.

 

Edit to add: here’s one working example of a purely appian-based expression to capture the IDs and Labels from the original HTML code above.  (Note, this could probably just be done using “extract()”, but i’ve looped in the Appian RegEx functions to strengthen the initial matches and protect against false positives).

a!localVariables(  
  
  local!idArray: regexsearch(
    pattern: "value=""(\d{2,3})""",
    searchString: ri!extractedText,
    regexFlags: "gsm"
  ),
  local!ids: tointeger(a!flatten(a!forEach(
    local!idArray.match,
    extract(fv!item, """", """")
  ))),
  
  local!labelArray: regexsearch(
    pattern: ">(.+?)</option>",
    searchString: ri!extractedText,
    regexFlags: "gsm"
  ),
  local!labels: a!flatten(a!forEach(
    local!labelArray.match,
    extract(fv!item, ">", "</option")
  )),
  
  {}
)

results

 

The Expression Guru
Participating Frequently
August 5, 2026

What makes this tricky is that not all of the rows in your data are valid json strings or even have the same characters for double quotations. So I think we need to understand more about your context to help you with any code.

In theory, this is doable via a combination of the displayvalue and index functions.

mikes0011
Brainy
August 5, 2026

yeah, OP didn’t even specify whether that JSON string they included is somehow their main source-of-truth data, or just a visual representation of their data (since they said “table data” after all) - these things make a difference as far as what we can possibly recommend here.

The Expression Guru
New Participant
August 6, 2026

Thank you for your help.

 

I have a robot task where the robot needs to retrieve the contents of a table from an HTML page. The JSON result matches what I’m able to achieve by retrieving the first column using this CSS code:

“#Objectifs-” & sum(fv!index,-1) & “-code_objectif”

 

Here is the modified HTML code to include only the first column containing the dropdown.

<div class="dataTables_scroll">
<div class="dataTables_scrollHead" style="overflow: hidden; position: relative; border: 0px; width: 100%;">
<div class="dataTables_scrollHeadInner" style="box-sizing: content-box; width: 832px; padding-right: 0px;">
<table class="table table-bordered table-hover no-footer dataTable" role="grid"
aria-describedby="Objectifs_info" style="margin-left: 0px; width: 832px;">
<thead>
<tr role="row">
<th width="31%" style="text-align: center; width: 200px;" class="sorting_asc sorting_disabled"
tabindex="0" aria-controls="Objectifs" rowspan="1" colspan="1" aria-sort="ascending"
aria-label="Objectifs contrat: activate to sort column descending">Objectifs contrat
</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="dataTables_scrollBody"
style="position: relative; overflow: auto; width: 100%; max-height: 15em; height: 15em;">
<table id="Objectifs" class="table table-bordered table-hover no-footer dataTable" role="grid"
aria-describedby="Objectifs_info" style="position: absolute; top: 0px; left: 0px; width: 100%;">
<thead>
<tr role="row" style="height: 0px;">
<th width="31%"
style="text-align: center; padding-top: 0px; padding-bottom: 0px; border-top-width: 0px; border-bottom-width: 0px; height: 0px; width: 200px;"
class="sorting_asc sorting_disabled" aria-controls="Objectifs" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="Objectifs contrat: activate to sort column descending">
<div class="dataTables_sizing" style="height:0;overflow:hidden;">Objectifs contrat</div>
</th>
</tr>
</thead>
<tbody>
<tr id="Objectifs-0" name="Objectifs-0" role="row" class="odd">
<td class=""><select class="form-control" id="Objectifs-0-code_objectif"
name="Objectifs-0-code_objectif" style="width: 100%;">
<option value="0">(Aucun)</option>
<option value="84" selected="selected">Agir sur ses difficultés administratives</option>
<option value="86">Agir sur ses difficultés d'hébergement</option>
<option value="88">Agir sur ses difficultés de logement</option>
<option value="85">Agir sur ses difficultés financières</option>
<option value="87">Agir sur ses difficultés juridiques</option>
<option value="89">Définir le projet de création/reprise d'entreprise</option>
<option value="91">Développer sa mobilité</option>
<option value="93">Développer ses capacités en lecture et écriture</option>
<option value="92">Développer son autonomie numérique</option>
<option value="90">Développer son entreprise</option>
<option value="94">Elaborer son projet professionnel et ou formation</option>
<option value="95">Engager une remobilisation socio-professionnelle</option>
<option value="96">Exercer une activité rémunérée et déclarée</option>
<option value="97">Prendre en compte son état de santé</option>
<option value="98">Surmonter ses contraintes familiales</option>
</select>
</td>
</tr>
</tbody>
</table>
<div style="position: relative; top: 0px; left: 0px; width: 1px; height: 210px;"></div>
</div>
</div>