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 Pages / Portal Web API count r...
Power Pages
Unanswered

Portal Web API count records

(0) ShareShare
ReportReport
Posted on by 29

On the loosing focus from an email field I want to check for an existing  contact with the same email. What is the best way to achieve this, using the API ? 

Any examples would be great 

 

Gary 

 

Categories:
I have the same question (0)
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @gmanuki 

     

    You could use eventually JavaScript when the field last focus and try to call any of the following. 

     

    1. You can create a Power Automate flow using the Dataverse environment and use the email field to retrieve the existing email address and call the Power Automate via JavaScript.  Below is an example for you 

     

    https://www.alphabold.com/how-to-trigger-power-automate-flow-from-power-apps-portals/ 

     

    2. You can use web API also, and use JavaScript. Have a look at the following answer from @OliverRodrigues 

    https://powerusers.microsoft.com/t5/Power-Apps-Portals/How-to-retrieve-records-by-Portal-Web-Api/td-p/779069 

     

    Especially to retrieve records: https://microsoft-business-applications.hcltech.com/development/creating-a-custom-portal-api-retrieve-data/ 

     

    3. You can use workflow in the background and retrieve the email field. 

     

    Bonus: You can also create plugins if needed. 

     


    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

  • Fubar Profile Picture
    8,379 Super User 2025 Season 2 on at

    Just be mindful, that you may open a security hole where someone can farm your users email addresses - so make sure you architect it appropriately (e.g. if you used Web API you need to be aware that that would require Global Read  on the Contact record with at least the Email address field exposed, with this setting someone can open the browser debugger/console and write their own query to pull a list of email addresses.)

  • gmanuki Profile Picture
    29 on at

    I will use option 2 since the API now  supports GET

     

     

  • PaulJSwider Profile Picture
    152 on at

    There is no need to use the API. I would just flag the table to not allow duplicates or turn the duplicate feature on. This is very common, there are built-in tools.  Do this at the DV level of the Portal Env.

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/admin/detect-duplicate-data?view=op-9-1

    Mark if answered please. Thanks!

  • gmanuki Profile Picture
    29 on at

    @pswider Thanks but I'm validating an email field on loose focus and need to display the error in real time before i commit . 

  • PaulJSwider Profile Picture
    152 on at

    Gotcha. Plug-ins as stated above.

     

    Good luck! 

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 Pages

#1
Fubar Profile Picture

Fubar 89 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard