Skip to main content
Cadet | Tier 2
November 19, 2025
Question

Problem with Log File

  • November 19, 2025
  • 3 replies
  • 109 views

Hi I created a directory named "C:\\RPA\\MeuBot\\Log" and a file named "Bernardo.Log" on my computer and added a JSON with the path of it in the Config of my Control Room. I also have created a dictionary directing both paths. However, when I try to call the open the log file with this dictionary it always creates an error message , that is how I am writing the path to the log file $p_dicConfig{DIRETORIO_LOG}$/$p_dicConfig{NOME_ARQUIVO_LOG}$ . I need to access the log file by using the dictionary I was ordered to not access it by using "C:\\RPA\\MeuBot\\Log\\Bernardo.Log” this way 

 

    3 replies

    Padmakumar
    Premier Pathfinder | Tier 7
    Premier Pathfinder | Tier 7
    November 20, 2025

    Hi ​@bernardocavalcante,

     

    In A360, when you read a JSON into a Dictionary and want to reference its values:

    • Use quotes around the key:

                   p_dicConfig{"DIRETORIO_LOG"} - Correct
                   not p_dicConfig{DIRETORIO_LOG} - Wrong

    • Use the Windows path separator \ (or \\ inside JSON), not /.
    • Ensure your JSON paths have escaped backslashes:

                   "DIRETORIO_LOG": "C:\\RPA\\MeuBot\\Log",
                   "NOME_ARQUIVO_LOG": "Bernardo.Log"

    $p_dicConfig{"DIRETORIO_LOG"}$ + "\" + $p_dicConfig{"NOME_ARQUIVO_LOG"}$

    • JSON keys have escaped backslashes:
    • "DIRETORIO_LOG": "C:\\RPA\\MeuBot\\Log"
    • Dictionary keys use quotes: {"KEY"}
    • Use \ (not /) for Windows paths.

    This will resolve the error.

    Padmakumar
    Cadet | Tier 2
    November 23, 2025

    Hi @Padmakumar, thank you for the guidance!

    I followed your advice and added the quotes to the dictionary keys (e.g., $p_dicConfig{"KEY"}$). However, I am now facing a "Path not found" error specifically at Line 14 (inside the Catch block).

    Looking at the error message (screenshot attached), it says: "Verify the file path '+'/' + ' and try again."

    It seems like the bot is interpreting the + characters literally instead of performing a string concatenation.

    Currently, my syntax in the "Log to File" path field is: $p_dicConfig{"DIRETORIO_LOG"}$ + "/" + $p_dicConfig{"NOME_ARQUIVO_LOG"}$

    Should I remove the + operators and just place the variables next to each other (like $Var1$\$Var2$)? Or could this be an issue with the dictionary variable returning null?

     

    Padmakumar
    Premier Pathfinder | Tier 7
    Premier Pathfinder | Tier 7
    November 25, 2025

    Hi @Padmakumar, thank you for the guidance!

    I followed your advice and added the quotes to the dictionary keys (e.g., $p_dicConfig{"KEY"}$). However, I am now facing a "Path not found" error specifically at Line 14 (inside the Catch block).

    Looking at the error message (screenshot attached), it says: "Verify the file path '+'/' + ' and try again."

    It seems like the bot is interpreting the + characters literally instead of performing a string concatenation.

    Currently, my syntax in the "Log to File" path field is: $p_dicConfig{"DIRETORIO_LOG"}$ + "/" + $p_dicConfig{"NOME_ARQUIVO_LOG"}$

    Should I remove the + operators and just place the variables next to each other (like $Var1$\$Var2$)? Or could this be an issue with the dictionary variable returning null?

     

    The error message confirms the issue: A360 is treating + and as literal text, not as concatenation. This happens because the Log to File action does not parse expressions—it expects a single resolved string.
     

    Remove all + and / from the Log to File path field and build the full path in a String variable first.

     


    String: Assign → sLogPath
    sLogPath = $p_dicConfig{"DIRETORIO_LOG"}$ + "\" + $p_dicConfig{"NOME_ARQUIVO_LOG"}$

    (Use \ for Windows paths.)


    In Log to File, set File path to: $sLogPath$

     

    Note: It will be better to use a message box and pass the $sLogPath$ before the Log to File action to see the value you are getting.
    Padmakumar