Skip to main content
Known Participant
Oct 28, 2021 11:25 AM UTC
Question

converting

Hi, using local variable, i am calling expression rule, which gives category codes as output, now i neeed to convert this local!updatecategorycodes into array form to use contains() function.

can anyone please help me

local!updateCategoryCodes:index(
rule!CNAM_qeGetUpdateCategoryCodes(),
"CATEGORY_CODE",
""
),

    9 replies

    stewart.burchell
    Employee
    Oct 28, 2021 11:46 AM UTC

    I'm not sure I understand the problem. Assuming the result of rule!CNAM_qeGetUpdateCategoryCodes() is a list of items, then index() WILL return an array to local!updateCategoryCodes, even if the list only has one item in it,.

    stewart.burchell
    Employee
    Oct 28, 2021 11:53 AM UTC

    Just realized that you may be facing the issue that the index() is returning a List of Variant, and that you may be attempting to reference an item as a string in your contains() function. If so, you need to make sure that both data types are equivalent i.e. turn you List of Variant into a List of Text String by using fn!touniformstring()

    andrewh0007
    Inspiring
    Oct 28, 2021 11:51 AM UTC

    I think we'll need a tad more information. We can't see what's in your rule!CNAM_qeGetUpdateCategoryCodes() but it appears to be a query. I'll have a go but it may be well of the mark as more detail is needed.

    If I wanted to know if a query code existed I wouldn't call the query, index to "CATEGORY_CODE" then check with a contains I would instead input the category codes I was looking for into the query (via a!queryFilter()) and check if anything is returned.

    If I'm off the mark, please give more details.

    New Participant
    Jan 12, 2023 4:07 AM UTC

    I still can't find the most appropriate solution to this problem word hurdle

    New Participant
    Feb 28, 2023 3:05 AM UTC

    yes, I completely agree with you, this is a very good and useful article for me. backrooms game

    abhayd3663
    Brainy
    Feb 28, 2023 4:11 AM UTC

    index() will already give you a array of items, did you try the contains() function?