Hi,
I'm working on a analytic app which will override the XML of the Table tool. As I'm trying to write the override XML I'm having an issue understanding where the <Rule Name= > value comes from under the <StyleRules>
Here is some example XML from the table tool with the field value I have questions on listed in Red
<Configuration>
<TableMode>Basic</TableMode>
<GroupingFields orderChanged="False" />
<Width>100%</Width>
<ShowHeader value="True" />
<ShowBarGraph value="False" />
<TableFields orderChanged="False">
<Field name="Modification_Type" selected="True" Alignment="Left" />
<Field name="Name" selected="True" Alignment="Left" />
<Field name="Birth_Date" selected="True" Alignment="Left" />
<Field name="Address_Line_1" selected="True" Alignment="Left" Width="" />
<Field name="Name_Change" selected="True" Alignment="Left" />
<Field name="Birth_Date_Change" selected="True" Alignment="Left" />
<Field name="Address_Line_1_Change" selected="True" Alignment="Left" />
<Field name="*Unknown" selected="True" Alignment="Right" />
</TableFields>
<TableStyles>
<Style Name="Data" Font="Arial" Size="8" TextColor="#000000" BackColor="#ffffff" AltColor="#f0f0f0" RowGroup="1" />
<Style Name="Header" Font="Arial" Size="10" TextColor="#000000" BackColor="#dbdbdb" />
<Style Name="Borders" Width="1" DataColor="#000000" HeaderColor="#000000" RowBorder="None" BasicColBorder="Default (Use Per Column Setting)" />
<Style Name="Table" CellPadding="0" ColumnPadding="0" TableBorder="true" Width="1" BorderColor="#000000" />
</TableStyles>
<StyleRules>
<Rule Name="48615fe8-8d6b-4cb2-91ae-18d69ff61689">
<RowRule value="False" />
<HighPrecedence value="False" />
<Field>Address_Line_1</Field>
<Test>Formula</Test>
<ApplyTo>Data</ApplyTo>
<SimpleVar />
<SimpleOp>==</SimpleOp>
<SimpleConst>1</SimpleConst>
<Formula>[Address_Line_1_Change] = 'Y'</Formula>
<Style BackColor="#80ff80" />
<PrettyName>Address_Line_1 Rule 1</PrettyName>
</Rule>
</StyleRules>
</Configuration>
When I was writing my override XML code I was randomly just setting the Rule Name value to
' <Rule Name="90efef4c-b3f0-4173-8239-' + padleft(tostring([RecordID]),12,'0') + '"> ' taking the last 12 characters and replacing it with my RecordID.
My question is how are these <Rule Name= values determined?
And do the values matter?
I'm guessing the values matter because I did not hit any errors but the highlighting of the field did not work, based upon what the column rule was.
Solved! Go to Solution.
Hello @AdamSt ,
Just out of curiosity. If you replace the RuleName with the pretty name, will that still error?
Let me know.
Hi ImadZidan,
I tried replacing the Rule Name value with the value I was populating for the PrettyName and the code didn't error but also it didn't work either, so same result as I had previously.
Here is what my XML override code looked like
The Row Rules in Green worked fine but they are also using a static field I will have in all of my compares (the Modification_Type field) and so for those I simply used some Rule Names that got generated when I was looking at a Table Tool XML. The Column Rules in Red did not error but also did not work. I have provided 2 attachments. The "F2FC Test Input.xlsx" shows how the input data looked and "Dynamic Render Report XLSX.xlsx" is what the output report looked like. The issue is that the Address_Line_1 field for the Change record should show up as Green because the Address_Line_1_Change value is set to 'Y', but I doesn't. (These input and output files contain dummy data just for illustration)
<Configuration>
<TableMode>Basic</TableMode>
<GroupingFields orderChanged="False" />
<Width>100%</Width>
<ShowHeader value="True" />
<ShowBarGraph value="False" />
<TableFields orderChanged="False">
<Field name="*Unknown" selected="True" Alignment="Right" />
</TableFields>
<TableStyles>
<Style Name="Data" Font="Arial" Size="8" TextColor="#000000" BackColor="#ffffff" AltColor="#ffffff" RowGroup="1" />
<Style Name="Header" Font="Arial" Size="10" TextColor="#000000" BackColor="#dbdbdb" />
<Style Name="Borders" Width="1" DataColor="#000000" HeaderColor="#000000" RowBorder="Per Row" BasicColBorder="All Columns (Override Per Column Setting)" />
<Style Name="Table" CellPadding="0" ColumnPadding="0" TableBorder="true" Width="1" BorderColor="#000000" />
</TableStyles>
<StyleRules>
<Rule Name="fcfb705f-5f74-4412-9486-ac377432d6e5">
<RowRule value="True" />
<HighPrecedence value="True" />
<Field />
<Test>Formula</Test>
<ApplyTo>Data</ApplyTo>
<SimpleVar />
<SimpleOp>==</SimpleOp>
<SimpleConst>1</SimpleConst>
<Formula>[Modification_Type] in ('Add')</Formula>
<Style BackColor="#ffff80" />
<PrettyName>Row Rule 1</PrettyName>
</Rule>
<Rule Name="ba1cbcdc-b1af-46fd-b579-a44aa1166d1d">
<RowRule value="True" />
<HighPrecedence value="True" />
<Field />
<Test>Formula</Test>
<ApplyTo>Data</ApplyTo>
<SimpleVar />
<SimpleOp>==</SimpleOp>
<SimpleConst>1</SimpleConst>
<Formula>[Modification_Type] in ('Drop')</Formula>
<Style BackColor="#ff8080" />
<PrettyName>Row Rule 2</PrettyName>
</Rule>
<Rule Name="Name Rule 1">
<RowRule value="False" />
<HighPrecedence value="False" />
<Field>Name</Field>
<Test>Simple</Test>
<ApplyTo>Data</ApplyTo>
<SimpleVar />
<SimpleOp>==</SimpleOp>
<SimpleConst>1</SimpleConst>
<Formula>[Name_Change] = 'Y'</Formula>
<Style BackColor="#80ff80" />
<PrettyName>Name Rule 1</PrettyName>
</Rule>
<Rule Name="Birth_Date Rule 1">
<RowRule value="False" />
<HighPrecedence value="False" />
<Field>Birth_Date</Field>
<Test>Simple</Test>
<ApplyTo>Data</ApplyTo>
<SimpleVar />
<SimpleOp>==</SimpleOp>
<SimpleConst>1</SimpleConst>
<Formula>[Birth_Date_Change] = 'Y'</Formula>
<Style BackColor="#80ff80" />
<PrettyName>Birth_Date Rule 1</PrettyName>
</Rule>
<Rule Name="Address_Line_1 Rule 1">
<RowRule value="False" />
<HighPrecedence value="False" />
<Field>Address_Line_1</Field>
<Test>Simple</Test>
<ApplyTo>Data</ApplyTo>
<SimpleVar />
<SimpleOp>==</SimpleOp>
<SimpleConst>1</SimpleConst>
<Formula>[Address_Line_1_Change] = 'Y'</Formula>
<Style BackColor="#80ff80" />
<PrettyName>Address_Line_1 Rule 1</PrettyName>
</Rule>
</StyleRules>
</Configuration>
Hi @AdamSt
The rule name values of the form "fcfb705f-5f74-4412-9486-ac377432d6e5" are Universally Unique IDs(UUID) that are generated in a way to ensure that probability of ever finding two the same is extremely small. Alteryx can create them using the UUIDCreate() function.
From the workflow point of view, all that's important is that the Rule Name is unique in each workflow. It's possible having unique names in each Table tool would work, but unique across the entire workflow is a technique I've used before.
As to why the column rules aren't being applied, you have the HighPrecedenceValue="True" on both of your row rules. This corresponds to checking the "This rule should overwrite conflicting Per-Column rules" option in the UI. Without seeing your data it's difficult to tell, but could your Row Rules always be overriding your column rules?
Dan
Hello @AdamSt ,
I see what is happening here. Ensure that your xml options are valid.
For instance and taking one example:
Notice the text in green. Option Simple references the when option, whilst formula references the formula option
which I think what you are seeking.
Your xml:
<Rule Name="Birth_Date Rule 1">
<RowRule value="False" />
<HighPrecedence value="False" />
<Field>Birth_Date</Field>
<Test>Simple</Test>
<ApplyTo>Data</ApplyTo>
<SimpleVar />
<SimpleOp>==</SimpleOp>
<SimpleConst>1</SimpleConst>
<Formula>[Birth_Date_Change] = 'Y'</Formula>
<Style BackColor="#80ff80" />
<PrettyName>Birth_Date Rule 1</PrettyName>
</Rule>
Should be :
<Rule Name="Birth_Date Rule 1">
<RowRule value="False" />
<HighPrecedence value="False" />
<Field>Birth_Date</Field>
<Test>Formula</Test>
<ApplyTo>Data</ApplyTo>
<SimpleVar />
<SimpleOp>==</SimpleOp>
<SimpleConst>1</SimpleConst>
<Formula>[Birth_Date_Change] = 'Y'</Formula>
<Style BackColor="#80ff80" />
<PrettyName>Birth_Date Rule 1</PrettyName>
</Rule>
I also agree with @danilang . The rule name should be unique and that's why I suggested the pretty name which seems unique to the field. If not ensure its uniqueness.
Hi @ImadZidan ,
You were correct that my XML was incorrect in the <Test> value.
I switched it from Simple to Formula and it is now working.
Thank you so much for your help!
Also @danilang ,
Thank you for your guidance on the Rule Name value. Although it didn't end up being the root cause of my issue I now to have a better understanding of how it is generated.
Thanks to both of you for your help!
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |