The goal of capsule is to borrow just One contact number from the contact search result of contactInfos of type ContactInfo and output or add into a structure with other properties.
Getting ContactNameConcept input from User via Bixby Voice.
text (ContactNameConcept) {
extends(contact.SearchTerm)
}
Using ContactNameConcept as input contactName to get search results from Contacts.
action (FindContactNumber) {
type (Calculation)
collect {
input (contactName) {
type (ContactNameConcept)
min (Optional) max (One)
}
computed-input (contactInfos) {
type (contact.ContactInfo)
min (Optional) max (Many)
compute {
intent {
goal: contact.FindContact
value: $expr(contactName)
}
}
// What should be done here?
}
}
Thanks
If the idea is when
contact.FindContactreturns multiple results, only send one to the linked Javascript, developer can do the followingHowever, I would say it is also possible to handle all results in Javascript. Consider the case when user search for "John", and there are "John Smith" and "John Doe". Depends on your capsule, it might make sense to handle both in Javascript.