Skip to main content
April 9, 2024
Question

Getting error in User interface at where condition

  • April 9, 2024
  • 6 replies
  • 0 views

I am below error in user interface.Please help to resolve.

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function 'wherecontains' [line 52]: Invalid types, can only act on data of the same type (Text, Any Type)

Below is the Code and the place where wherecontains is there is highligted in red.Please help to resolve as to what changes needs to be done.

ri!selectedSkuId
),
local!selectedSku: a!refreshVariable(
refreshAfter: "RECORD_ACTION",
refreshOnVarChange: local!selectedSkuId,
value: rule!APN_first(
index(
local!skus,
wherecontains(
local!selectedSkuId,
local!skus['recordType!{9de47fad-3776-4334-bca6-7870632f65f6}NGP_PC_Sku.fields.{821936eb-32c0-4523-ab28-06972108537f}pcSkuId']
),
{}
)
)
),
{
a!columnsLayout(
columns: {
a!columnLayout(
contents: {
rule!NGP_PC_CMPT_skuInfo(
skus: local!skus,
refCountries: local!refCountries,
selectedSkuId: local!selectedSkuId,
selectedSku: local!selectedSku,
defaultSelectedSkuId: local!defaultSelectedSkuId,
disableProductSelection: ri!disableProductSelection
)

    6 replies

    stefanhelzle0001
    Brainy
    April 9, 2024

    Use touniformstring() to turn your local!skus['recordType!{9de47fad-3776-4334-bca6-7870632f65f6}NGP_PC_Sku.fields.{821936eb-32c0-4523-ab28-06972108537f}pcSkuId'] into a list of text.

    April 9, 2024

    getting below error

    Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error in rule 'ngp_pc_cmpt_skuinfo' at function a!dropdownField [line 14]: A dropdown component [label="Select SKU"] has an invalid value for "value". Value cannot be null if placeholder is also null.

    Changed the code as below:

    index(
    local!skus,
    wherecontains(
    touniformstring(local!selectedSkuId),
    touniformstring(local!skus['recordType!{9de47fad-3776-4334-bca6-7870632f65f6}NGP_PC_Sku.fields.{821936eb-32c0-4523-ab28-06972108537f}pcSkuId'])
    ),

    stefanhelzle0001
    Brainy
    April 9, 2024

    Did you read the error message? Just add a placeholder label to the drop down field.

    vinaykumarp8308
    Participating Frequently
    April 9, 2024

    [mention:ffba947918f44b98ae5abe7badb7e8fc:e9ed411860ed4f2ba0265705b8793d05] ,

    [line 52]: Invalid types, can only act on data of the same type (Text, Any Type) - Make sure values and array should be of same type.

    As mentioned by [mention:a11f77a729fb4db2af76b09948583328:e9ed411860ed4f2ba0265705b8793d05] , please convert your array of values -  local!skus['recordType!{9de47fad-3776-4334-bca6-7870632f65f6}NGP_PC_Sku.fields.{821936eb-32c0-4523-ab28-06972108537f}pcSkuId'] to text by using touniformstring() .