Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek-v3-0324· DeepSeekHugging Face LMArena Human Preference 140K

InvalidTemplate Unable to process template language expressions in action…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-opus-4-20250514’s answer.
  1. User

    InvalidTemplate Unable to process template language expressions in action 'Gerar_Iniciais' inputs at line '0' and column '0': 'The template language expression 'if( empty(trim(variables('NomeRemetente'))), 'ZZ', concat( substring(first(split(trim(variables('NomeRemetente')), ' '))?[0], 0, 1), substring(last(split(trim(variables('NomeRemetente')), ' '))?[0], 0, 1) ) )' cannot be evaluated because property '0' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.

    this is in microsoft power automate.

  2. DeepSeek Assistant

    The error you're encountering in Microsoft Power Automate is related to how you're trying to access array elements in your expression. The issue is with the array indexing syntax (?[0]) being used on string values rather than arrays.

    Here's the corrected expression for your "Gerar_Iniciais" action:

    if(
        empty(trim(variables('NomeRemetente'))),
        'ZZ',
        concat(
            substring(first(split(trim(variables('NomeRemetente')), ' ')), 0, 1),
            substring(last(split(trim(variables('NomeRemetente')), ' ')), 0, 1)
        )
    )
    

    Key changes:

    1. Removed the ?[0] array indexing - this isn't needed because first() and last() already return the first and last elements respectively
    2. The split() function returns an array, and first()/last() return the array elements directly

    This expression will:

    1. Check if the 'NomeRemetente' variable is empty or whitespace
    2. If empty, return 'ZZ'
    3. If not empty, return the first letter of the first word and first letter of the last word concatenated together

    For example, if 'NomeRemetente' is "John Doe", it will return "JD". If empty, it returns "ZZ".

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.