web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Referencing a variable...
Copilot Studio
Answered

Referencing a variable that hasn't been populated, forces it to be populated

(1) ShareShare
ReportReport
Posted on by 13

Hello,

I've run into an issue with a condition, where I would like to ask the user a question and then ask them a follow up question if their response is one of two things.

 

Ideally, I would want to be able to save the response to the follow up (in this instance, a custom email address) in the "SendEmail" variable, so that it covers both scenarios. However, this isn't possible so I've had to save it as a separate variable "CustomEmail".

 

The main problem arises when I try to call my Power Automate flow, which is configured to take both of the variables. If the user chooses 'Default', then I would expect the CustomEmail variable to not be populated, which I can handle in the flow. What actually happens, as seen below, is that the bot forces the custom email question on the user even though they chose the 'Default' response.

Surely this isn't intended behaviour?

wturner123_0-1620378363996.png

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This looks like a pretty big omission, surely this cannot be working as intended 🙂 Help, please 🙂

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Hi @wturner123  / @Anonymous ,

     

    Unfortunately, it's not possible to pass an empty variable to your workflow yet.

    We have an idea here: Allow PVA to send 'NULL' values to Power Automate - Power Platform Community (microsoft.com)

     

    My suggestion: Create two different workflows, it's better.

  • wturner123 Profile Picture
    13 on at

    Thanks for the reply.

     

    Unfortunately, this causes so much duplication of code/actions. This is just a sample of the actual topic we have, but essentially the Power Automate flow returns a "JobId" value which is used by several other steps that proceed this in the topic.

     

    By splitting out this part where we call the flow and return a JobId, we'd have to also duplicate everything after that, as we also can't set the same JobId variable globally from two separate topics.

     

    There's a few things that would solve this, which all seem to be unavailable as far as I can tell:

    1. Set the value of a variable without the use of the "Ask a question" action

    2. Passing null values to Power Automate

    3. Re-using variables - i.e. "Ask a question" could update an existing variable, rather than having to declare brand new ones

     

    Keen to know if there's any other solution available that I'm missing.

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks 🙂 - in other words - we did not miss anything, it is just currently not possible to do. Shame...

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    @wturner123 ,

     

    You can do a workaround.

     

    1- Create an entity (left menu) called "Email Type" with:

    - Default

    - Custom (and here, add some synonymous like: "Custom:  user@site.net " " Custom - user_name@mysite.com.eg" "custom user.Name12@website.net" )

     

    and turn on the Smart matching.

     

    2- Go to your topic and modify the question to use the entity instead of fixed options. And a note inside your question for the user like "Note: If you want to use custom email, send Custom - youremail@contoso.com"

     

    3- Create the condition again to guarantee the connection with the new question

     

    3- Remove the Email question

     

    4- In your workflow, remove the CustomEmail parameter

     

    5- Done!

  • wturner123 Profile Picture
    13 on at

    Thanks for the replies again.

     

    I can't see a way to retrieve the actual email that they've entered though? It correctly matches "Custom", but this is also what is returned.

     

    wturner123_0-1620395193434.png

     

  • Verified answer
    wturner123 Profile Picture
    13 on at

    Managed to come up with some sort of solution which seems to work.

     

    By having an open question and asking the user to answer in a particular way, we can then capture the response and validate it in a Power Automate flow. If it's deemed to be invalid, we can loop back until they've entered a valid response.

    wturner123_0-1620400403426.png

     

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Great @wturner123 !

    My suggestion is not working because when you use a custom entity with synonymous, you cannot get the whole value entered by user 😞 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for trying to help 🙂 In a very convoluted way, we got what we wanted 😄

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 447

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 101 Super User 2026 Season 1

#3
chiaraalina Profile Picture

chiaraalina 65 Super User 2026 Season 1

Last 30 days Overall leaderboard