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 / Power Apps / need help with code to...
Power Apps
Answered

need help with code to select email addresses in a drop down box to then assign in power automate

(0) ShareShare
ReportReport
Posted on by 20

I have the variable; Set(
varESWRequestServiceManager,
drpServiceManager.Selected.Value
);  

with the drop box where staff can select an email address. I'm using this variable in Power Automate Approvals with the variable in the assign to section. It's giving me the error that it can't recognise the email address. If I put in one of the addresses in the assign to box it does not fail so isn't an issue with the email but instead the variable not being able to find the address in the drop down box.

I'm very new to power automate and power apps and any help would be hugely appreciated

Thanks

Categories:
  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @mccowatts ,

     

    What's the formula you used in dropdown?

    Does it contains only emails or records where email ID is present?

     

    To check in simple way, add a label on your screen as use the following code:

    Do check if you only get email as text

    drpServiceManager.Selected.Value
    //OR
    drpServiceManager.Selected.Email
    

     

    Once you get email in label then the syntax is correct and pass that in your variable as 

    Set(
     varESWRequestServiceManager,
     Text(drpServiceManager.Selected.Email)
    ); 

     

    Let me know if this works 

  • mccowatts Profile Picture
    20 on at

    Thanks for your help. There's only email addresses in the drop box items. It won't let me add 'Email' at the end of the code. Say's it's not recognised

     

  • Ethan_009 Profile Picture
    4,840 Moderator on at

    @mccowatts ,

    Could you provide screenshot of the error and where you are facing it?

  • mccowatts Profile Picture
    20 on at

    mccowatts_0-1683700743636.png

     

  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @mccowatts ,

     

    I just tried passing the email in flow and it successfully triggered using email ID.

    Ethan_R_0-1683701658263.png

     

    I found a related post with same error: Check the post if this helps

    Also, make sure the email is in proper format else the flow will fail.

     

    Hope this helps

  • mccowatts Profile Picture
    20 on at

    How do I change to an email ID? Sorry very much a newbie!

     

     

  • Verified answer
    Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @mccowatts ,

    I used a argument for my flow.

     

    Similarly, how are you passing the data to your Flow?

    What's the trigger that you are using?

     

    Suggesting to use Instant Flow,

    Step 1: You can use PowerApps (purple) connector from Instant Flows.

    Step 2: In the Flow, where you have 'AssignedTo' add dynamic value as 'Ask from PowerApps'

    Step 3: Connect the Flow in your App

    Step 4: As you will run the flow, code brackets will tell you the this flow has certain parameters required. 

    Step 5: Pass your variable and trigger the flow

     

    Hope this gives you an idea.

     

  • mccowatts Profile Picture
    20 on at

    this is how I'm doing it with an initialise variable;

    mccowatts_0-1683703975199.png

    and start and wait for an approval;

    mccowatts_1-1683704002171.png

     

  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Okay @mccowatts ,

     

    I hope you are passing the variable in your Flow,

    Syntax would be like,

    FlowName.Run(varESWRequestServiceManager)
    
    //Considering that your 1st argument in Flow is Email parameter then pass variable to the Flow in the 1st argument itself

    Note: Handle Null values too else your flow will fail

     

    So is the flow running by setting proper data from the App in your Flow? (Check data passed in each step from Run History of Flow)

     

    As you mentioned that email is proper,

    So if a proper value passed and set then your Flow will Approval action will trigger correctly.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard