AI-102 Exam QuestionsBrowse all questions from this exam

AI-102 Exam - Question 327


HOTSPOT -

You are developing the shopping on-the-go project.

You need to build the Adaptive Card for the chatbot.

How should you complete the code? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

Show Answer
Correct Answer:

Box 1: name.en -

Box 2: "$when": "${stockLevel != 'OK'}"

Product displays must include images and warnings when stock levels are low or out of stock.

Box 3:image.altText.en

Discussion

13 comments
Sign in to comment
halfway
Dec 8, 2022

1. name[language] 2. "$when": "${stockLevel} != 'OK'" 3. image.altText[language]

MarceloManhaes
Jul 3, 2024

I ´m sure if is correct if you see the shopping on the go project requirements for chatbot that says the multi-language approach

nastolgia
Nov 28, 2024

im agree with you. 1) name[language] - in task we app should support 3 languages 2) $when": "${stockLevel} != 'OK' - If item is not in the stock show 3) image.altText[language] - Show alt.text in different languages

james2033
Aug 14, 2023

File JSON { "sku": "b1", "name": { "en": "Bicycle", "es": "Bicicleta", "pt": "Bicicleta" }, "stocklevel": "Out of Stock", "description": { "en": "Bicycle", "es": "Bicicleta", "pt": "Bicicleta" }, "image": { "uri": "https://upload.wordwideimporters.org/bicycle.jpg", "alttext": { "en": "Bicycle", "es": "Bicicleta", "pt": "Bicicleta" } }, "createdUtc": "2020-0214T06:08:39Z", "language": "en" } 1. name.en 2. "$when": "${stockLevel != 'OK'}" 3. image.altText.en

upliftinghut
May 2, 2024

This is correct because the structure of original requirement Json is reflected and replaced by $<parameter name>

sl_mslconsulting
Sep 23, 2023

You don’t want code it in a way that the code just works with en - it’s a bad coding practice.

AzureJobsTillRetire
Mar 4, 2023

The given answers are correct. The correct answer pairs for box1 and box3 could be- name.en and image.altText.en name["language"] and image.altText["language"] since name["language"] does not exist as an option in box3, we will have to choose the first pair as the correct answer. https://www.w3schools.com/js/js_json_syntax.asp

ParkXD
Jul 27, 2022

it seems a repeat question, but with a slight different option. The earlier one with altText.[language], but this altText[language] without . which one is right?

Canyu
Nov 28, 2022

This is a repeat question, but this time the answer does not give an explanation or reference document. Is this answer correct?

sdokmak
Jun 22, 2022

If there was an option for name.[language] instead of name[language] then I'd use that for more than one language option, otherwise we can't. For name[language], language would have to be an integer but it's a string, wouldn't work. But.. for name.[language], that works. https://stackoverflow.com/questions/882727/is-there-a-way-to-use-variable-keys-in-a-javascript-object-literal

RamonKaus
Jul 24, 2022

This is a repeat of an earlier question but they changed the answer? Weird.

fba825b
Jun 16, 2024

How I understood it: The description in the first table says that the app and the user input is in english => app is in english => adaptive card should be in english In addition to that, the provided JSON has a language property with value 'en'. So, my guess is: 1. name.en 2. "$when": "${stockLevel != 'OK'}" 3. image.altText.en

Toby86
Jul 9, 2024

Requirement: "Support interactions in English, Spanish, and Portuguese" If you hard set it on english, how can you satisfy this requirement? must be name[language] on top and AltText.[language] on bottom.

takaimomoGcup
May 20, 2024

Is this question still available on May 21, 2024?

NagaoShingo
Jun 14, 2024

1. name.en 2. "$when": "${stockLevel != 'OK'}" 3. image.altText.en

krzkrzkra
Jul 12, 2024

1. name.en 2. "$when": "${stockLevel != 'OK'}" 3. image.altText.en

mrg998
Sep 15, 2024

Let's evaluate why the other options for answer3 are not valid: image.altText.en: This option hardcodes the language to English (en). image.altText.language: This option assumes language is a property under altText. However, language is a variable representing the selected language (e.g., en, es, pt), not a property within altText. image.altText.[“language”]: This option incorrectly uses quotation marks around language, treating it as a literal string rather than a variable. This would attempt to look for an alt text property with the name "language", which does not exist. Correct Option: image.altText.[language] Explanation: This option correctly uses the language variable to dynamically access the appropriate alt text based on the user's selected language. It ensures that the alt text is in the correct language (English, Spanish, or Portuguese) by referencing the variable directly. This fulfills the requirement for a multilingual customer experience.