I'm trying to build a "message board" in my app and these field_value are the message fields that I am trying to extract and display.
How do I extract this specific field field_value? There are 6 Users currently in the status S030 - Approved", from the HTTP response below.
As you can see this specific message is Identified by the "id":"100001" I want to extract the field_value from the block that has "field_name":"common_desc_0"
The actual response is extremely long and I've just shortened this so that I can post it here without exceeding the limit. This is the HTTP response:
{
"RESPONSE":{
"GenericListAnswer":{
"empty_top_toolbar":"0",
"no_move_columns":"0",
"no_add_rem_columns":"0",
"no_sort_columns":"0",
"no_resize_columns":"0",
"no_oper_columns":"0",
"refresh_data":{
"ApplEra":"",
"delay":"0"
},
"no_gui_link":"0",
"index_last":"11",
"max_num_rows":"0",
"index_true_last":"11",
"is_history":"0",
"index_first_visible":"1",
"display_table_name":"Board",
"table_id":"25018",
"table_name":"Board",
"global_operation":[
{
"id":"5013",
"key":"show_all_records"
},
{
"id":"5005",
"key":"search"
},
{
"id":"2016",
"key":"print_list_selected"
},
{
"id":"5015",
"key":"download_csv_batch"
},
{
"id":"5014",
"key":"download_csv_gui"
},
{
"id":"5016",
"key":"download_xlsx_gui"
},
{
"id":"2015",
"key":"print_list_all"
},
{
"id":"46",
"key":"mark_as_read"
},
{
"id":"47",
"key":"mark_as_unread"
},
{
"id":"42",
"key":"create_news"
},
{
"id":"3",
"key":"view",
"only1":"1"
},
{
"id":"11",
"key":"edit",
"only1":"1"
},
{
"id":"0",
"key":"delete"
},
{
"id":"64",
"key":"set_valid"
},
{
"id":"65",
"key":"set_invalid"
},
{
"id":"15",
"key":"insert"
},
{
"id":"132",
"key":"clone",
"only1":"1"
},
{
"id":"84",
"key":"set_lock"
},
{
"id":"85",
"key":"set_unlock"
}
],
"num_visible":"200",
"list_type":"0",
"list_key":"1",
"parent_Class_id":"0",
"parent_common_id":"0",
"parent_applcol_id":"0",
"search_num":"0",
"id_box_search_num":"0",
"mad_key_list":"",
"choose_xsl":"0",
"is_search_popup":"0",
"section_list_params":"",
"QuickSearch":{
"quick_search_column":[
"Description",
"Description 1"
]
},
"description":"",
"wf_configured":"0",
"op_parameter":"",
"ListNode":[
{
"id":"100001",
"mad_key":"100001",
"is_custom":"0",
"is_locked":"0",
"is_inactive":"0",
"run_hyperlink":{
"classid":"25018",
"id":"100001",
"mad_key":"100001"
},
"field":[
{
"field_name":"common_desc_0",
"col_index":"1",
"field_value":"There are 6 Users currently in the status S030 - Approved",
"mad_key":"0",
"id":"0"
},
{
"field_name":"btime_touched",
"col_index":"2",
"field_value":"25/09/2020 22:33:24",
"mad_key":"0",
"id":"0"
},
{
"field_name":"date_end",
"col_index":"3",
"field_value":"",
"mad_key":"0",
"id":"0"
},
{
"field_name":"desc_board",
"col_index":"4",
"field_value":"There are 6 Users currently in the status S030 - Approved",
"mad_key":"0",
"id":"0"
}
]
}
This is the code for the GET request :
var response = await http.get(
Uri.parse(
'http://192.168.1.8:8080/HongLeong/MENU_REQUEST.do?_dc=1657717579436&table_id=25018&id_MenuAction=3&reset_context=1&ViewType=MENU_REQUEST&gui_open_popup=1&id_Window=5&activeWindowId=mw_5&noOrigUserDate=true&LocalDate=20220713&LocalTime=21061900&TimeZone=Asia/Shanghai&UserDate=0&UserTime=0&server_name=OPRISK_DATACOLLECTOR&key_id_list=&cell_context_id=0&id_Desktop=100237&operation_key=1000007&operation_sub_num=-1&is_json=1&is_popup=0&is_search_window=0&ccsfw_conf_by_user=0&is_batch=0&previousToken=1657717554097&historyToken=1657717579434&historyUrl=1'),
headers: {HttpHeaders.cookieHeader: cookies},
);
final message = jsonDecode(response.body.toString());
await WriteCache.setString(key: "cache", value: message1.toString());
print(message);
