Notifications
Announcements
Hi,
I'm trying to chain together information from a custom copilot (using Copilot Studio) and hitting a wall with parsing out variables from a generative response. So far I've successfully created a topic that extracts vehicle properties from a SharePoint Excel file. The generative answer includes a 7 digit identifying number as part of a block of text. I've tried using parse value and set variable value nodes with a formula to extract that 7 digit number and save to a new variable for use in an API call. The Power Fx functions in the formula bar don't seem to support regex to extract this bit of information. Searching through the formula reference, I can't come up with any alternatives that would work. Surely there must be a way to manipulate a string output for use in another action. What am I missing?
Thanks
Hey @SC1043
PowerFx is available when you set a variable in copilot studio.
When you need to perform a REGEX in a PowerFx context you can take a look at this IsMatch, Match, and MatchAll functions - Power Platform | Microsoft Learn
(Bonus: ChatGPT is really good to generate the right REGEX for you 😁)
I hope it helps,
Kr,
Y.
Thanks for the response. Match is in fact the first thing I tried, but it doesn't seem to be one of the functions available in Copilot Studio. My formula below generates this error: "'Match' is a recognized but not supported function."
@SC1043
I understand your situation, I see 3 alternative solutions:
- You could adjust the prompt in your generative answer node to produce two values as the response. First would be the text you're presently generating, and then you could include a separator (like "||") followed by the 7 digits you need. Afterwards, you can use PowerFx to split this text using the separator, and then get the second item from the newly formed array.
- You could also create a flow that employs a GPT model or AI Builder to perform data extraction.
- Another option is to establish a flow with a Dataverse instant plug-in. This would perform data extraction using the Match function (What is Microsoft Dataverse Accelerator? (dynamics.com))
Good luck ! I hope you reach your goals asap !
kr,
Thanks for the additional suggestions Yassinel.
I've tried modifying the instructions in the generative answer node to separate or demarcate the number variable I'm trying to capture, but it seems to be resistant to that guidance. I've done some initial poking around with the flows you've suggested. I appreciate there's more capability there, but so far I haven't been able to successfully call a function and return the output I'm looking for to copilot studio. I'll have to keep chipping away at it.
Hey @SC1043,
Here is an example of an instant plugin that perform a REGEX used in a Power Automate context
- Open this app
- Click on Create instant plugin.
- Then you can add your input field / output field and your Power FX
And this is how I call my plugin in a Power Automate flow.
If you pass to your flow the generated text and then you pass that text to you Dataverse action, the output should be the desired value (of course you need to adapt the power fx with your REGEX)
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 255 Super User 2025 Season 2
Romain The Low-Code... 205 Super User 2025 Season 2
S-Venkadesh 101 Moderator