User interface for select tool
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All,
I am trying to give an interface for select tool, Please find the attached workflow.
Here I am selecting the required columns using list box, users can select which specific columns they require to be outputted and it is working. But how can I deselect some specific columns using a user interface, that is all columns should be outputted except those are selected by the user.
Solved! Go to Solution.
- Labels:
- Best Practices
- Common Use Cases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Namshad
Here's an approach:
- You need to change the Select Tool Mode to Generate a Custom List - watch out you need to leave "Start" and "End" in blank and "Separator" as a single comma (,).
- Then, for the action Tool, you need to update the Raw XML with a formula:
' <SelectFields>
<SelectField field="' + replace(EscapeXMLMetacharacters([#1]), ",", '" selected="False" />
<SelectField field="') + '" selected="False" />
<SelectField field="*Unknown" selected="True" />
</SelectFields>'
This is a tough Formula to understand at first. But the main part of the formula resides here:
replace(EscapeXMLMetacharacters([#1]), ",", '" selected="False" />
<SelectField field="')
Basically, imagine that the list of fields to be deselected will come like this if the user selects the first 4 of them in the List Box interface.
Emp_ID, Emp_Name, Age, salary
This part of the formula is replacing the comma (,) between each field by this expression
" selected="False" />
<SelectField field="
It's basically closing out the expression that deselects a Field (changes it to False) and then starts the following after that.
It's a little bit hard to understand, but it works fine.
See attached.
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you! This solution worked well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Thableaus
Thank for the solution!
In the workflow you shared if we select all columns then there will be some error in select tool as there is no column is remaining deselected and to be outputted from that select tool. This issue will be solved if we pass a dummy column before that select tool as I did in the workflow attached.
I need another branch which outputs the selected columns also , for this I have changed your work flow ( Please find the attached workflow ) in which one branch outputs selected columns and next branch outputs the remaining columns which are not selected.
Case 1 ( working fine 😞 -- If we select all columns then I get only that dummy column outputted in "deselected data.yxdb". No error occurs in this case.
Case 2 ( I am facing an issue ) : if we don't select any column then I am getting an error in the branch for columns which are selected. Actually in this case I need to avoid this error by outputting the dummy column through that select tool into "selected data.yxdb"
Friends , please share me if any fix to solve this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
let's say you wanted to use the list box to update a select tool and a formula tool. could you leave the quotation marks in the separator to satisfy the formula tool, then in the action tool connected to the select tool, where the action tool is configured to update raw xml, you could surround the double quotations with single?
