cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wturner123
New Member

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
wturner123
New Member

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

 

View solution in original post

10 REPLIES 10
cblackuk
New Member

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

renatoromao
Super User
Super User

Hi @wturner123  / @cblackuk ,

 

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.


Did I answer your question? Mark my post as a solution!
Thanks!

Renato Romão,

Connect with me here 😉

Power Virtual Agents course (+2.650 students) : English | Português
wturner123
New Member

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.

renatoromao
Super User
Super User

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

renatoromao
Super User
Super User

@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!


Did I answer your question? Mark my post as a solution!
Thanks!

Renato Romão,

Connect with me here 😉

Power Virtual Agents course (+2.650 students) : English | Português
wturner123
New Member

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

 

wturner123
New Member

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

 

View solution in original post

renatoromao
Super User
Super User

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 😞 


Did I answer your question? Mark my post as a solution!
Thanks!

Renato Romão,

Connect with me here 😉

Power Virtual Agents course (+2.650 students) : English | Português

Helpful resources

Announcements
V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

PVA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,061)