New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Input value substitution" does not work on Input.ChoiceSet in Outlook Actionable Message where style is "expanded" #1733
Comments
In the "Action.Http" object, value of property "body" has to of type string. Instead you are passing a json object as value. Simply serialize you body object in to string and use that as value for "body" property. { |
Hi @mavarshn |
I just tested with the payload. I replaced the action endpoint with my test service and you can see the value being passed to the service are correct. Use following payload and go to the service and checkout the body value being passed - https://actionsplayground.azurewebsites.net/workspaces/CL04WzSFxEKS9mT_NBhBog# { |
Hi @mavarshn I am not sure why it is working for you but not for me. I must be doing something wrong. Allow me to clarify a bit: {"type":"AdaptiveCard","version":"1.0","originator":"f5b240ef-995d-449f-a1ab-bca7ae0295f3","style":"emphasis","hideOriginalBody":true,"body":[{"type":"Container","style":"default","items":[{"type":"TextBlock","text":"Andy expanded choice","weight":"bolder","size":"medium"},{"type":"Container","items":[{"type":"TextBlock","wrap":true,"text":"New Multiple Selection"},{"type":"Input.ChoiceSet","id":"1","style":"expanded","choices":[{"title":"Choice 1","value":"1"},{"title":"Choice 2","value":"2"},{"title":"Choice 3","value":"3"}]}]}]}],"actions":[{"method":"POST","title":"Submit","type":"Action.Http","headers":[{"Content-Type":"application/json"}],"url":"https://www.requestwatch.com/w/xf6c0e6q","body":"{"1":"{{1.value}}","type":"survey","sysparm_instance_id":"2591c3a7dbd7130004fb57935e96195a","sysparm_action":"submit"}"}]} I stringify it and inject it into the email I am sending. The full email HTML body looks like below: <script type="application/adaptivecard+json">{"type":"AdaptiveCard","version":"1.0","originator":"f5b240ef-995d-449f-a1ab-bca7ae0295f3","style":"emphasis","hideOriginalBody":true,"body":[{"type":"Container","style":"default","items":[{"type":"TextBlock","text":"Andy expanded choice","weight":"bolder","size":"medium"},{"type":"Container","items":[{"type":"TextBlock","wrap":true,"text":"New Multiple Selection"},{"type":"Input.ChoiceSet","id":"1","style":"expanded","choices":[{"title":"Choice 1","value":"1"},{"title":"Choice 2","value":"2"},{"title":"Choice 3","value":"3"}]}]}]}],"actions":[{"method":"POST","title":"Submit","type":"Action.Http","headers":[{"Content-Type":"application/json"}],"url":"https://www.requestwatch.com/w/xf6c0e6q","body":"{\"1\":\"{{1.value}}\",\"type\":\"survey\",\"sysparm_instance_id\":\"2591c3a7dbd7130004fb57935e96195a\",\"sysparm_action\":\"submit\"}"}]}</script>
Here is my RequestWatch response and the input value is empty (I did select a value when responding in outlook): If I switch style from "expanded" to "compact", the value returns properly. Am I missing something? Thanks, |
Your body only as reference to 1.value
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: beef1218 <notifications@github.com>
Sent: Friday, July 20, 2018 4:41 PM
To: Microsoft/AdaptiveCards
Cc: Mayank Varsney; Mention
Subject: Re: [Microsoft/AdaptiveCards] "Input value substitution" does not work on Input.ChoiceSet in Outlook Actionable Message where style is "expanded" (#1733)
Hi @mavarshn<https://github.com/mavarshn>
I am not sure why it is working for you but not for me. I must be doing something wrong.
Allow me to clarify a bit:
Basically I have below JSON as my adaptivecard:
{"type":"AdaptiveCard","version":"1.0","originator":"f5b240ef-995d-449f-a1ab-bca7ae0295f3","style":"emphasis","hideOriginalBody":true,"body":[{"type":"Container","style":"default","items":[{"type":"TextBlock","text":"Andy expanded choice","weight":"bolder","size":"medium"},{"type":"Container","items":[{"type":"TextBlock","wrap":true,"text":"New Multiple Selection"},{"type":"Input.ChoiceSet","id":"1","style":"expanded","choices":[{"title":"Choice 1","value":"1"},{"title":"Choice 2","value":"2"},{"title":"Choice 3","value":"3"}]}]}]}],"actions":[{"method":"POST","title":"Submit","type":"Action.Http","headers":[{"Content-Type":"application/json"}],"url":"https://www.requestwatch.com/w/xf6c0e6q","body":"{"1":"{{1.value}}","type":"survey","sysparm_instance_id":"2591c3a7dbd7130004fb57935e96195a","sysparm_action":"submit"}"}]}
I stringify it and inject it into the email I am sending. The full email HTML body looks like below:
<script type="application/adaptivecard+json">{"type":"AdaptiveCard","version":"1.0","originator":"f5b240ef-995d-449f-a1ab-bca7ae0295f3","style":"emphasis","hideOriginalBody":true,"body":[{"type":"Container","style":"default","items":[{"type":"TextBlock","text":"Andy expanded choice","weight":"bolder","size":"medium"},{"type":"Container","items":[{"type":"TextBlock","wrap":true,"text":"New Multiple Selection"},{"type":"Input.ChoiceSet","id":"1","style":"expanded","choices":[{"title":"Choice 1","value":"1"},{"title":"Choice 2","value":"2"},{"title":"Choice 3","value":"3"}]}]}]}],"actions":[{"method":"POST","title":"Submit","type":"Action.Http","headers":[{"Content-Type":"application/json"}],"url":"https://www.requestwatch.com/w/xf6c0e6q","body":"{\"1\":\"{{1.value}}\",\"type\":\"survey\",\"sysparm_instance_id\":\"2591c3a7dbd7130004fb57935e96195a\",\"sysparm_action\":\"submit\"}"}]}</script>
Here is my RequestWatch response and the input value is empty (I did select a value when responding in outlook):
https://www.requestwatch.com/w/xf6c0e6q<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.requestwatch.com%2Fw%2Fxf6c0e6q&data=02%7C01%7Cmavarshn%40microsoft.com%7C76d5b887ae6f41128ea508d5ee9a3e6e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636677268601296221&sdata=EvyZ07g0YRTI%2F36W7DHiP5GjnjImDfX2MQ9lAQYAJPs%3D&reserved=0>
If I switch style from "expanded" to "compact", the value returns properly. Am I missing something?
Thanks,
Andy
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1733 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AJ4sg2U3FKqwXb_d6LGl_6tUtdLWq6wuks5uImqIgaJpZM4VZPkq>.
|
Sorry I forgot to mention that I removed a question leaving just one choice question in this latest adaptive card. Its ID is "1" with style as "expanded". |
Closing as stale, please re-open if you still have any issues, thanks! |
Platform
I use Outlook web version as client and www.requestwatch.com to monitor HTTP requests.
Author or host
I use a 3rd party application to send an email that contains below adaptivecard to outlook:
{
"type":"AdaptiveCard",
"version":"1.0",
"originator":"981df751-1a61-47d6-9b18-ff57408fc9d1",
"style":"emphasis",
"hideOriginalBody":true,
"body":[
{
"type":"Container",
"style":"default",
"items":[
{
"type":"TextBlock",
"text":"Andy test",
"weight":"bolder",
"size":"medium"
},
{
"type":"Container",
"items":[
{
"type":"TextBlock",
"wrap":true,
"text":"Question 1"
},
{
"type":"Input.ChoiceSet",
"id":"1",
"style":"compact",
"choices":[
{
"title":"Choice 1",
"value":"1"
},
{
"title":"Choice 2",
"value":"2"
},
{
"title":"Choice 3",
"value":"3"
}
]
}
]
},
{
"type":"Container",
"items":[
{
"type":"TextBlock",
"wrap":true,
"text":"Question 2"
},
{
"type":"Input.ChoiceSet",
"id":"2",
"style":"expanded",
"choices":[
{
"title":"Choice 1",
"value":"1"
},
{
"title":"Choice 2",
"value":"2"
},
{
"title":"Choice 3",
"value":"3"
}
]
}
]
}
]
}
],
"actions":[
{
"method":"POST",
"title":"Submit",
"type":"Action.Http",
"headers":[
{
"Content-Type":"application/json"
}
],
"url":"https://www.requestwatch.com/w/4d9wrjen",
"body":{
"1":"{{1.value}}",
"2":"{{2.value}}",
"type":"survey"
}
}
]
}
In this adaptive card, I have 2 Input.ChoiceSet with IDs as "1" and "2".
"1" has style as "compact" and "2" has style as "expanded".
Issue
After I selected my choices in outlook and send the HTTP request back, in the payload I can see {{2.value}} is empty. The input substitution did not work for Input.ChoiceSet where style is "expanded".
The text was updated successfully, but these errors were encountered: