Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Update action tool using Raw XML option

sonaliabc
5 - Atom

Hi Everyone,

 

I have been working on a workflow where I need to get all the entries which are duplicate against few user selected fields in the data set. The user has the ability to select any number of dynamic fields to check for duplicacy from the data set using list box.

 

The problem occurs when we don't get any option to select all the fields at once in "Only Unique tool" . I believe this can be done using "update using Raw XML" option in Action tool but I am not able to configure it to get the result.

 

For checking dublicate values, I am using "Only Unique Tool" from crew macro to get the desired output. 

 

I have attached the sample workflow along with the sample data and output. Please help me with this. Thank you so much!

Here is an screenshot of the workflow .

 

sonaliabc_0-1684739724049.png

 

Result after selecting Id and country for checking duplicate

sonaliabc_1-1684739807178.png

 

2 REPLIES 2
danilang
19 - Altair
19 - Altair

Hi @sonaliabc 

 

In order to use Update Raw XML with formula, you need to know the Raw XML that you're trying to update.  You can open the workflow file in Notepad or your equivalent text editor of choice and hunt through the file to find the XML for the control in question.  An easier way to do it is to check Display XML in Properties Window on the Advanced tab of the User Settings window.

danilang_0-1684762310885.png

This gives a new option in the configuration pane for all tools to display the corresponding XML for the tool

danilang_2-1684762537373.png

 

The piece that you'll be recreating is highlighted in green.  And the way that you'll be creating it is in the List Box tool.  

danilang_3-1684762765091.png

Check Generate Custom List and fill in the Start, Separator and End text fields with the corresponding XML from the Only unique tool

 

Start = <Field field="
Separator = "/><Field field="
End = "/>

 

 

In the action tool select Update Raw XML with Formula, select the Value field and use [#1] as the formula.  [#1] is the place holder for the string coming from the List Box Tool.  

danilang_4-1684763316394.png

 

This sets the correct XML for the Only Unique Macro. 

 

Unfortunately, changing the mode in the List Box tool means that you can't use Update Select With Multi-Select List Box when connected to the Select tool.  You now need to use Update Raw XML with Formula and pass the correct XML to the Select tool as well.  the xml that you need to modify is the green part shown below

<SelectFields>
   <SelectField field="ID" selected="True" />
   <SelectField field="Country" selected="True" />
   <SelectField field="*Unknown" selected="False" />
</SelectFields>

 

Luckily, the overall structure is similar to the the XML for the Only unique, so the formula in action tool for the Select tool is quite simple

 

replace(replace([#1],"&lt;","<Select"),"&gt;",">")+'<SelectField field="*Unknown" selected="False" />' 

 

 

It replaces "&lt;" with "<Select", "&lt;" with ">" and adds the XML for the Unknown field

danilang_5-1684764083159.png

 

Dan

 

 

 

 

 

 

sonaliabc
5 - Atom

Hi @danilang ,

 

Thank you so much for the detail breakdown.

I really appreciate your help and taking the time out to help me with the solution.
I have been able to achieve the desired output.

Labels