on 2020 Dec 25 9:14 AM
Good Day,
would be possible to format/design the chat-bot to display results data from the json data source as table row and have one of them as hyberlink
can we use the CSS by any chance,
-----------------------------------------------------------------------------------------------------
Hawaii STATE_NAME 15 STATE_FIPS Pacific SUB_REGION HI STATE_ABBR 1211537 POP2000 1299555 POP2007 189.9 POP00_SQMI 203.7 POP07_SQMI 294102 WHITE 22003 BLACK 3535 AMERI_ES 503868 ASIAN 113539 HAWN_PI 15147 OTHER 259343 MULT_RACE 87699 HISPANIC 608671 MALES 602866 FEMALES 78163 AGE_UNDER5 217604 AGE_5_17 65456 AGE_18_21 133437 AGE_22_29 183094 AGE_30_39 185646 AGE_40_49 187536 AGE_50_64 160601 AGE_65_UP 36.2 MED_AGE 35.1 MED_AGE_M 37.4 MED_AGE_F 403240 HOUSEHOLDS 2.92 AVE_HH_SZ 43253 HSEHLD_1_M 44900 HSEHLD_1_F 96758 MARHH_CHD 119319 MARHH_NO_C 8945 MHH_CHILD 23619 FHH_CHILD 287068 FAMILIES 3.42 AVE_FAM_SZ 460542 HSE_UNITS 57302 VACANT 227888 OWNER_OCC 175352 RENTER_OCC 5473 NO_FARMS97 263 AVG_SIZE97 292107 CROP_ACR97 90.8 AVG_SALE97 6381 SQMI 11.952786902763334 Shape_Length 1.429288927291385 Shape_Area 11.952786902763334 Shape_Length 1.429288927 Shape_Area
Request clarification before answering.
I am able to return the attribute called STATE_NAME ("Hawaii") with this:
{{api_service_response.default.body.features[0].attributes.STATE_NAME}}
If you want to create a list of the attributes (it is not an array but you can iterate ver an object's properties), so I used something like this:
{
"type": "list",
"delay": "",
"content": {
"title": "Items",
"subtitle": "With Price",
"imageUrl": "",
"total": "30",
"upperBoundText": "Too many options to display",
"buttons": [
{{#eachJoin api_service_response.default.body.features.[0].attributes}}
{
"title": "{{@key}}",
"value": "{{this}}",
"type": "postback"
}
{{/eachJoin}}
],
"elements": [
{{#eachJoin api_service_response.default.body.features.[0].attributes}}
{
"title": "{{@key}}",
"subtitle": "{{this}}",
"imageUrl": "",
"status": "available",
"statusState": "success",
"description": "Food",
"buttons": [
{
"title": "Buy",
"value": "Buy",
"type": "postback"
}
]
}
{{/eachJoin}}
]
}
}
The dot before the index of the array (features.[0]) is important. Not sure this code is resilient because it hardcodes taking the first element of the features array, but you will have to adjust based on use cases and how the API works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi moaen.mustafa,
Yes.I am using MS Teams as channel and it is possible to display content like table.( as we do in web pages )
Use HTML Tag in your text message.
Ex: <table border="1"></table> with support of <tr>,<th>,<td> tags.
and you can use {{#eachJoin}} & {{#each}} for managing nested structures from Json array in side the HTML tags.
Note: you cannot test it in SAP CAI test.
Thanks,
Roy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good Day,
Thank you for your reply .. so much appreciated. I shall try this and let you know..
Must important two questions which I am searching for answer ..
1. Can I ran a chatbot internally inside intranet domain which had no internet access at all .
2. Can I integrate with Active Directly .
3. Can I have voice recognition ? Any demo bot which can you recommend
I can setup a meeting using teams or Zoom to show you what I am planning to develop.
Warm regards
If you are going to iterate through the the JSON, you should use the Custom message type. As for table row -- the UI is not designed for any UI and ALOT of text. Why not use the List -- which allows some information for eahc item and then a link.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your reply.
I tried the list element , but I don't know the exact code to access the key and the value element . E.g ... Objectid :
State_name : Alabama.
I was able to get the field name from the fields array, but couldn't link them to the actual value from the features array
Any suggestions to link the two array together.
Thanks
Hi,
Please see the below screenshot, what I need to show each attributes key name alongside with his value in the List as a table row .
"OBJECTID" :1, Map(GIS Map link)
"STATE_NAME":"Hawaii",
"STATE_FIPS":"15",
" SUB_REGION":"Pacific"
, "STATE_ABBR":"HI"
, "POP2000":1211537,
"POP2007" :1299555,
" POP00_SQMI " :189.90000000000001,
....
..
The Data source can be accessed from here the following link, GIS
Please don't use the HTML table format unless and until you decide MS Teams is your Channel.
No other Channels ( as far I checked, MS Teams, Slack, WebChat, Fiori) not working with HTML tags.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This might help you.
Also for voice recognition, I remeber there is a blog please have a check..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.