Some people wrestle with darkness, not me. I love shadows. Especially Copilot Studio data related ones.
Whilst being obsessed with Wednesday season 2, I decided to experiment with Adaptive Cards again. I wanted to build cool record creation automation between Copilot Studio agents and my Dynamics 365/ Model-Driven Apps. Always being in Sales Ops and CRM, I see how processes can be simplified.
Yes, a geek never ceases to dream and develop.
So, in this long-overdue Adaptive Cards series post, let’s go down a new rabbit hole together. The mapping of date variables from an Adaptive Card into Dataverse with Power Automate as an action.
Well, that’s a great question. And it all boils down to a discovery I made when building this new task automation agent (more on the full build for this agent in an upcoming post).
It all started one late night watching Wednesday Season 2 whilst multitasking (hail ADHD gods) with this agent build.
The concept for the agent UX I created is simple: The end user fills in various data bits including a Due Date in the Adaptive Card. This is captured as a data variable both in the input component for the card structure and inside the card’s JSON, as well as in the variable mapping. So far, all peaceful.
Then, I went to build the Power Automate flow which I would invoke as an action upon the Adaptive Card submission. For this, I used in the skills trigger a date-type input. Again, all seems innocent so far right?
The real fun starts when I went back into Copilot Studio and invoked the flow. Suddenly, I am asked to map the input variables again, but with a dark twist might I add.
The input variable has turned into a string as far as Copilot Studio is concerned. And here I am, mapping it to a date variable. Which of course, gave me the error Input variable “dueDate” is of incorrect type: Date.
Enter the twilight zone. Or that is how I felt at least.
Try data manipulation instead.
The message was loud and clear, no matter how much I tried to redo the solution in the hope I had missed something obvious. No no, this needed a hack.
So, allow me to share with you the step-by-step guide to hacking this typecasting issue.
In the Adaptive Card’s properties, make sure that you have chosen the Input.Date component with the appropriate id. In this case, it was named dueDate. For now, you can use a date variable in its normal format.
Once done with the properties, go into the Outputs section of Copilot Studio. Map the dueDate input to a custom topic variable of a date type. In this case, it was also named dueDate! What can I say, person of simple pleasures here.
Again in Copilot Studio, add a new node through Variable management and then Set a variable value. This is to manipulate our date input from the Adaptive Card, and turn it into a string value that the Power Automate flow will accept.
Now you can start converting. You will name our new string variable dueDateText. Then, you give it a value through a Power Fx expression which reads: Text(Topic.dueDate, “yyyy-mm-dd”). This essentially turns our previous date input into the ISO 8601 date string format your Dynamics 365/ Model-Driven App can ingest.
You go back to the Power Automate flow and change the Skills trigger’s input to take a text value for dueDate. This is because you will take the new string variable’s value as input for the flow.
Now you are ready to invoke our Power Automate flow. Create a new node in the topic for Add a tool and then pick our Create a new task Power Automate flow from the list.
Map the inputs. Remember, the variables in blue are what you added in the flow’s Skills trigger. Thus, you map your topic-created variable to it. For ease, naming it the same helps! (Or add a prefix like TopicVar)
As you can see, no error message this time around and the topic/ flow works fine!
If you enjoy building agents and working in Copilot Studio, or want to learn from community experts, what about exploring the Agent Creator Community?
The Agent Creator Community is where creators and AI enthusiasts come together to learn, share, and innovate. The goal is to empower individuals and organizations to harness the potential of intelligent agents, creating solutions for real-world impact.
You can even find the first cohort of agent creators here!
Check Angeliki Patsiavou’s original post https://www.empoweredhumans.net/post/fix-adaptive-card-date-issues-with-power-automate on www.empoweredhumans.net which was published 2025-08-23 23:55:00