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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to find the record...
Power Automate
Answered

How to find the record ID from sales force from a given variable

(1) ShareShare
ReportReport
Posted on by

Hi, 

 

I want to make a system where after an email is received to a specific account send an email with a form.  My actual idea is that with some of the information captured from the form use it as a reference for pulling out data from a salesforce record and then using that data for some further validations. I am struggling in how to get the record ID. 

 

image.png

 

For example that with an email (that would be captured from the Form sended to the user), being able to retrieve and capture some User Data from sales force for the specific record that contains the submitted email in the form. Is that possible? What is the best way for doing so? 

Categories:
I have the same question (0)
  • danmitchell36 Profile Picture
    268 on at

    You need to pull in the Salesforce user record from somewhere. Is the email address that the email comes from the email of the user record?

    If it is you can use this to find the record in Salesforce. Use "Get Records" and filter to where the user record has a matching email address. You can then store the Id of the user record and use it later.

  • Community Power Platform Member Profile Picture
    on at


    @danmitchell36 wrote:

    You need to pull in the Salesforce user record from somewhere. Is the email address that the email comes from the email of the user record?

    If it is you can use this to find the record in Salesforce. Use "Get Records" and filter to where the user record has a matching email address. You can then store the Id of the user record and use it later.



    Yeah absolutely, the email from the one who sent it could be the one of the user record...

     

    I understand what you are saying, I just don't know quite accurately how to do it, getting started with it. 

    image.png

    This are the only fields for the get records function in sales force. The record ID is a required field, should i make the filter inside that field? For example something like:  

     

    equals(body('Get_record')?['Email__c'], triggerBody()?['From']
     
    (Not sure with the "Body" after the equals) but anyways, was something similar to this what you suggest?

     image.png

     

    I had no clear idea of how to develop the solution. I really appreciate the help!
  • Verified answer
    danmitchell36 Profile Picture
    268 on at

    Ok, your issue is you are not using "Get Records" you are using "Get Record". These are not the same.


    Here is how you do it. Using the get records action filter so that email equals the "From" field from the email arriving trigger.

    The syntax is using OData. In this case I used Email eq 'From'. Please note that I have single quote marks around the From field.

    2019-07-22_17-29-13.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    If there is a user or users within Salesforce that have this email it will return it. 

    Next to make sure it works I will send an email with the user's full name in the body.

     

    Snag_1b62ebd6.png

     

     

     

     

     

     

     

     

     

     

     

    Now as soon as you put "Full Name" in the body of the email it will automatically put the entire email step in an "Apply to Each" loop. That is because the "Get Records" step could return multiple users. If it returned 6 users it would loop through the email step 6 times sending an email for each user that it found. 

    Here is what my whole Flow looks like:

     

    2019-07-22_17-35-33.png

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Now if I trigger this flow I get 2 emails because there are 2 users in the system with the same email:

     

    Snag_1b677640.png

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard