Activity Forums Salesforce® Discussions python concat auto insert backslash i can't remove

  • python concat auto insert backslash i can't remove

    Posted by Unknown Member on October 8, 2020 at 7:36 am

    I have a problem with my python concat, as you see the value of "item" holds the right value, but when i add it to a string, it inserts backslashes. I have tried with replace, rstrip and strip. Non of them worked.I don't know if I am missing something, hope you can help.
    a prints:
    `'"name": "[parameters(\'dynamicsax_1_Connection_Name\')]"'`
    item prints:
    `'dynamicsax_1_Connection_Name'
    `Code:
    `entries = Path("C:\\Users\\Aske.Meyer\\D365 Integration\\ERPD365AzureResources\\LogicApps")
    my_list_of_param = ['dynamicsax_1_Connection_Name', 'dynamicsax_2_Connection_Name','dynamicsax_3_Connection_Name',
    'servicebus_2_Connection_Name','servicebus_3_Connection_Name','servicebus_3_Connection_DisplayName',
    'servicebus_4_Connection_Name', 'servicebus_6_Connection_Name', 'servicebus_6_Connection_DisplayName',
    'documentdb_1_Connection_Name', 'documentdb_1_Connection_DisplayName', 'documentdb_1_databaseAccount']
    empty_list= []
    found_params = []
    not_found_params = []
    for entry in entries.iterdir():
    with open(entry) as file:
    print(file.name)
    content = json.load(file) #exclude param files
    parameter = content['parameters']
    for item in my_list_of_param:
    param_name = "\"name\": \"[parameters(\'"+item+"\')]\""
    a = param_name.replace("\\", "")
    print(a)
    print(item)`

    Unknown Member replied 4 years, 1 month ago 1 Member · 0 Replies
  • 0 Replies

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Popular Salesforce Infographics