need a specific format response

Options

I have a specific response format which like this

test:5.0:customer:{

"value1":1236,

"value2":"hello"

}

the key name is like this test:5.0:customer which static

but when i try to create this response using set filter expected result not come the result which come like this

test:5:

{

0:customer:

{

"value1":1236,

"value2":"hello"

}

}

which is wrong i don't want this format response i think its happened because of dot notation is sperate a key name to a object

Comments

  • jwhitlock
    jwhitlock Member
    Options

    I had one of these recently. Had to add a little javascript to make it work, because Xano confuses the period in the key name for dot notation. We built this little function.

    // Create an object with the key you want to updateconst myObject = $var.input_data
    // Specify the new key nameconst newKeyName = "company_data";
    // Get the value of the old keyconst valueToMove = myObject["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"];
    // Delete the old keydelete myObject["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"];
    // Create a new key with the desired name and copy the valuemyObject[newKeyName] = valueToMove;
    return myObject;

  • Xano freelance
    Options

    Thanks josh