Action.Submit validation #bot frameworkV4 - c#

My bot consists of adaptive card which has text box and submit.action,when user clicks on submit it does some action in the next dialog
Iam able to prompt the adaptive card and submit the action .
But i need 2things to be done here
1.for few cards when user go back and resubmit the form it has to submit with old data
2.when user go back and click submit it has to throw some prompt message saying card expired or submitted already
I an working with .net core,v4 and waterfall dialog
Can anyone help me in this.

There isn't an easy way to do this in the current state of the Bot Framework. Here's a couple of good options:
Use the AdaptiveCardPrompt. This isn't officially-supported, but I believe provides you with all of the customization you're looking for, out-of-the-box.
Attach your Adaptive Card to an ActivityPrompt and write a custom validator for it.
The trickiest part about your issue is collecting data from a card after the user has already completed the prompt. Once the prompt is over, there's no good way to use it. However, you could:
Add a card Id to the data property of the Action.Submit
Capture the input in OnMessageAsync()
If Activity.Value contains the card Id from step 1, handle it appropriately. Note, however, that it gets very difficult to use this within a dialog if the prompt has already completed.

You can go through the following link for handling user action https://learn.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-dialog-actions?view=azure-bot-service-3.0

Related

c# custom credential provider

I am trying to develop a custom credential provider. Trying to learn the basics. I implemented ICredentialProvider and ICredentialProviderCredential.
I added a custom credential tile, edit text and command link to windows logon UI.
What i want to do is, when i click on CommandButton i try to read textbox value but i could not do that.
I want to open a custom windows form (e.g MFA form), how can i open a custom form?
I am using phaetto/windows-credentials-provider implementation as example
There is not much information about this topic.
1. Text field
You must collect and keep securely the value(s) of text box(ex) field(s) as far as it is updated and your tile implementation class is notified about the change of that value.
You will be notified about every single character user entered into the text field. Be ready for this.
As far as user type info input text box your provider's method ICredentialProviderCredential::SetStringValue will be called on every text box update.
2. Popup window (dialog)
If you want to open any window you must acquire a parent window handle from Logon UI / Cred UI. Handle acquisition method is ICredentialProviderCredentialEvents::OnCreatingWindow.
You can find more details in the answer and it's comments: https://stackoverflow.com/a/52089207/3868464 .

Teams remove the More Actions menu Item when posting an Adaptive Card to Channel

I'm creating an escalation bot through the Bot Framework, using messaging extensions, when a users posts an issue(adaptive card) to the channel, a 'More Options' menu item appears when clicking on the eclipse of the post, this then allows users to make another issue on the same post. Is there a way to disable 'More Actions' so it is not shown/ or failing that disabled?
I'm not clear - do you NEED the "Actions" menu command at all? If not, just remove that option from your message extension. It can go into the "compose" box (when you create a new post), the "commandBox" (the main bar at the TOP of Teams) or "message" (this action menu you're talking about). From your other question today, it's clear you want it in "compose" box, but maybe you don't need it in the "message" action's menu. If that's correct, just de-select it in App Studio (i.e. in your manifest.json file).
If you -do- need it in the Actions box, you can't selectively turn it on/off, but you can choose how you respond when the user clicks that action. You could simply reply to the user that they've chosen an invalid option.

How to handle null user inputs within adaptive cards only

How can I show a user a red color message inside the adaptive card itself, when the user tries to hit the ok button without providing any input in the drop-down present in my adaptive cards. I don't want my Luis agent to handle it I want my UI to handle the above scenario
Adaptive Cards don't currently support client-side validation as per this answer from a MSFT employee. You will have to handle this scenario in your code that processes the user input. If the input is not valid, then you could send a message to the user saying please fill in the required fields X, Y, and Z, followed by the original Adaptive Card.
Edit - Additional sources
See this comment from a month ago about validation coming in Version 1.3, along with this issue which is tracking the current status of the input validation functionality.

MVC Forms - Toggle Model Validation

I have an MVC form which allows user to add some details about a "service" related to their account. My problem is that they can save and resume this form whenever they want so I don't need to check for required properties until they choose to "publish" this service.
My problem is I am not sure how to implement validation. I've looked here but I think I will need to use the same view because at any stage in the form they can choose to either "save and resume later" or "save and publish"(validation needed on this click).
I thought about maybe using a model without any required attributes up until the point where this "save and publish" button is clicked and on this click casting/converting the data from this model with no validation to the model with validation and checking validity but I am not sure if this is the correct way to go?
Any help/pointers appreciated.
Liam

How to write text to an external application

I'm developing an application to help the user write common text faster.
What I have in mind is a Windows app where the user can configure his key combinations, so that when he's, for instance, writing an email on Outlook or Gmail, he just has to press those keys and the text he configured before will be pasted into whatever app he's using.
So, instead of a user having to write "Dear sir, your order has been received succesfully" every time he receives an order and wants to send a confirmation email, he could just press something like "Crtl + O + R", and the corresponding text will be written for him.
I think that in order to achieve that my app has to do two things:
Intercept the key combination pressed buy the user when he's focused on a different app.
"Paste" the corresponding text to that app.
I have no real clue on how to achieve this, because what my app will be doing is something like "pasting" text on another app (otlook, word, notepad or whatever thing a user can type into), replacing the short text the user wrote with the long text he defined.
Any suggestions? I've looked into hot keys, but I'm not sure they're the way to go, and I also have no idea on how to "paste" the new text.
Thanks.
Have you considered simply adding text to the clipboard? Show the text next to a button that says "Copy to clipboard", and the user can just grab it and click Ctrl-V.
Can't think of a Windows app that does it this way, but I know it's possible; heck, Bit.ly can do it from your browser.

Categories

Resources