接口返回值為:

1 {"data":{"data":[[{"key1":"value1"},{"key2":"value2"},{"key3":"value3"}],[{"key11":"value11"},{"key12":"value12"},{"key13":"value13"}]]},"result":"1"} 2 3 #格式化 4 5 { 6 "data": { 7 "data": [ 8 [ 9 { 10 "key1": "value1" 11 }, 12 { 13 "key2": "value2" 14 }, 15 { 16 "key3": "value3" 17 } 18 ], 19 [ 20 { 21 "key11": "value11" 22 }, 23 { 24 "key12": "value12" 25 }, 26 { 27 "key13": "value13" 28 } 29 ] 30 ] 31 }, 32 "result": "1" 33 }
想取 value13,可以這樣寫
1 Comment ${res_utf8} decodeutf8 ${res_agree} #轉碼,如果不需要可注釋 2 ${res} Set Variable {"data":{"data":[[{"key1":"value1"},{"key2":"value2"},{"key3":"value3"}],[{"key11":"value11"},{"key12":"value12"},{"key13":"value13"}]]},"result":"1"} 3 ${res_json} to json ${res} #先將返回值轉成json,如果不需要可注釋 4 ${res_data} Get From Dictionary ${res_json} data #取第一層data 5 ${res_data2} Get From Dictionary ${res_data} data #取第二層data 6 ${res_list} Get From List ${res_data2} 1 #取list中第二個 7 ${res_list2} Get From List ${res_list} 2 #取list中第三個 8 ${res_key12} Get From Dictionary ${res_list2} key13 #取value13
結果如下: