Question on displaying info in grid

In my grid, I have Product Category and Product Description. There is always a Product Category but sometimes the is a Product Description. I want the Product Description to show in lieu of the Product Category. how do I accomplish that? (this will enable me to remove the column Product Description from the grid)

a!gridTextColumn(
label: "Product Category",
field: "PRODUCT_CATEGORY",
data:
apply(rule!RADARR_ER_applyCategoryByCategoryID(productCategory: local!productCategory, categoryID:_),
index(local!products.data, "PRODUCT_CATEGORY", null))
),
a!gridTextColumn(
label: "Product Description",
field: "PRODUCT_DESCRIPTION",
data:
apply(rule!RADARR_ER_applyDescriptionNameByDescriptionID(productDescri...

OriginalPostID-188768

OriginalPostID-188768

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    The general approach would be to put the a!gridTextColumn() and logic in a sub-rule. Pass both arrays of data in along with an index value (generated from "1+enumerate(count(local!products.data))"). Then check to see if the PRODUCT_DESCRIPTION[ri!idx] is null, if so run your query on the PRODUCT_CATEGORY or vice versa. Give it a go and post back any questions or problems.
Reply
  • 0
    Certified Lead Developer
    The general approach would be to put the a!gridTextColumn() and logic in a sub-rule. Pass both arrays of data in along with an index value (generated from "1+enumerate(count(local!products.data))"). Then check to see if the PRODUCT_DESCRIPTION[ri!idx] is null, if so run your query on the PRODUCT_CATEGORY or vice versa. Give it a go and post back any questions or problems.
Children
No Data