I've spent a long time going over documentation but have not been able to get a confirmation view to show up before running my action. What are the steps to adding a confirmation view to a capsule?
I have an action called Evaluate
and an address input that i automatically pull from the user's profile. I would like to confirm this address before running Evaluate
in case the user wants to use a different address
Here's what I have done:
1) import viv.common in capsule.bxb:
import (viv.common) {
as (common)
version (3.30.0)
}
2) add confirm/by statement to Evaluate action:
confirm {
by (common.Confirmation)
}
3) add a confirmation view that will match on the evaluate action:
confirmation-view {
match: common.Confirmation {
confirming {Evaluate (action) }
}
mode (PositiveEmphasis)
message ("Is this the correct address?")
render {
layout {
section {
content{
paragraph {
style (Title_XS)
value {
template (
"#{value(action.address)}}?"
)
}
}
}
}
}
}
confirm-options {
label ("Yes")
}
abort-options {
label ("Try another Address")
on-abort {
intent {
goal: InputAddress
}
}
}
}
I was hoping that would do it, but I think i'm missing something else. Any ideas?