Hi,
I have a bot with a Service node that sends SiteID to an API Service and then receives a AddressID back from my service.
webhook/api/client/v2.0/app/test-iyklx/service/ChatBot/incoming_webhook/GetOrderID?SiteID=add_001
{
“statusCode”: 200,
“body”: [
{
“_id”: “301”,
“service_name”: “Broadband Fibre”,
“service_description”: “Broadband Internet using Fibre as medium”,
“contact_site_id”: “cont_001”,
“address_site_id”: “add_001”,
“gis_lookup_flag”: “Yes”,
“olt_name”: “Rivonia OLT”,
“odn_refer”: “Elizabeth Avenue - Distribution 3”,
“precinct_ref”: “Rivonia Ext 11”,
“infra_provider”: “Vumatel”,
“phys_plan_check”: “Yes”,
“config_internet_profile”: “Yes”,
“ship_router_flag”: “”,
“MAC_address”: “704F57B63172”,
“serial_no”: “2179110002836”,
“router_make”: “tp-link”,
“router_model”: “Archer C20”,
“waybill_ref”: “SHEP01-00001051”,
“router_delivery_dt”: “”,
“drop_init_flag”: “”,
“drop_compl_dt”: “”,
“GPON_layer2_activated”: “”,
“GPON_dis_dt”: “”,
“service_live_dt”: “”,
“status”: “In-Progress”
},
{
“_id”: “401”,
“service_name”: “Broadband LTE”,
“service_description”: “Broadband Internet using wireless as medium”,
“contact_site_id”: “cont_001”,
“address_site_id”: “add_001”,
“gis_lookup_flag”: “Yes”,
“olt_name”: “Rivonia OLT”,
“odn_refer”: “Elizabeth Avenue - Distribution 3”,
“precinct_ref”: “Rivonia Ext 11”,
“infra_provider”: “Vumatel”,
“phys_plan_check”: “Yes”,
“config_internet_profile”: “Yes”,
“ship_router_flag”: “”,
“MAC_address”: “704F57B63172”,
“serial_no”: “2179110002836”,
“router_make”: “tp-link”,
“router_model”: “Archer C20”,
“waybill_ref”: “SHEP01-00001051”,
“router_delivery_dt”: “”,
“drop_init_flag”: “”,
“drop_compl_dt”: “”,
“GPON_layer2_activated”: “”,
“GPON_dis_dt”: “”,
“service_live_dt”: “”,
“status”: “In-Progress”
}
],
“headers”: {
“vary”: “Origin”,
“cache-control”: “no-cache, no-store, must-revalidate”,
“content-type”: “application/json”,
“content-encoding”: “gzip”,
“date”: “Tue, 28 Jan 2020 13:25:57 GMT”,
“connection”: “close”,
“x-frame-options”: “DENY”,
“content-length”: “460”
}
}
I then have a Script Node SetOrderList that does the following.
context.SetOrderList=context.GetOrder.response.body[0]._id;
I have a Message Node with the following Javascript
{
var order_list_arr;
var order_name_arr;
var arrayLength = context.GetOrder.response.body.length;
print(‘See the following order ID`s.’);
for (var i = 0; i < arrayLength; i++)
{
order_list_arr= (context.GetOrder.response.body[i]._id);
order_name_arr= (context.GetOrder.response.body[i].service_name);
print("\n");//next line
print(order_name_arr+" “+order_list_arr+”\n"); //list array
// print(order_name_arr+"\n"); //list array
}
}
Now I want to assign the ID that i receive back in my service node into a Entity Node list of Items(lookup)
I have tried context. however it returns nothing.
Is there a way to do this or perhaps call javascript Variables to be displayed for the user to select?