How to Keep Table Headers when using ReplaceTable (keep column mapping)
Hi- I am using Pega Robotics and am creating a data table by deserializing a json string. I have been using this output and replacing another table which has defined column names- and this table is used many times in the automation. However the problem arises when the first table's columns come in a different order. Since the second table is being overwritten when being replaced, there is no column mapping.
Any suggestions for a more intelligent way to do this? We are expecting the JSON to come in un-ordered fashion.
Should I try to work out of the first table? When trying this, I have a proxy object and not as many options with it.
I would adjust the column order in the incoming DataTable before you replace the existing table with it. The LookupTable is required to be well-defined; essentially unchanging, so if you call ReplaceTable with a DataTable that doesn't match the format you've defined for the LookupTable, it won't work properly. This adjustment would require some C# as the DataTable is not a Pega-specific object.
I did a quick test and it seems as though the extra columns in a "different" table were just eliminated. If I had a table that was simply in a different order, it seems the order was preserved, however that may have just been the DataGridView doing that.
Keep up to date on this post and subscribe to comments
- 7.1.9 How to track (keep a history of) previously assigned operator id when an assignment is transferred.
- Decision Table Column Header Not Frozen When Scrolling Down
- I have a class which is mapped to external DB, now I want two columns to be added in the table and that two columns as properties in the class, so what are the steps we need to follow to map properties and cloumn of table?
- Column is not populated when Exposing an embedded Single Value property value into a column and mapping it in external mapping
- Left spacing for the column headers and the contents of a table