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 Pages / How to check if a reco...
Power Pages
Answered

How to check if a record present or not in entity by scanning user QR code from portal

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Experts,

I am trying to validate a user once scanning its QR code. Basically there will be some set of gatekeeper Users/Contacts who is going to scan the Employees QR code on the gate but once the gatekeeper scan the QR code I need to validate that the scanned record is present in the entity or not.

I am able to scan the QR code but need to validate that record present or not in the entity.

How can I do that using fetchxml or any other way?

 

Please help me with this, any help will be appreciable.

Thanks,

Amit

Categories:
I have the same question (0)
  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @Anonymous ,

    wow, you managed the qr-stuff - great to hear - may be you could give some informations on that.

     

    The test could be done fairly easy in the backend with the entities tag in liquid: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects#entities

    But this would require posting back the data with the scanned code.

     

    A better approach could be ro create a liquid template which gets the id passed in and uses the mentioned code to find out, whether the id exists or not. It only returns a true/false. (well, i would recommend to render a json like { "success" : true } , this would make you future ready as you could expand the json).

    Then create a page template with that web template and untick "use page header and footer" and create a webpage with that page template.

    You then already can test it in a browser (or postman) by making a request to the page.

    When it works like you want, just make an ajaxcall ($.getJSON should do the job) from the client passing the id just scanned and show immediately the result without navigating.

    Hope it helps and is clearly enough explained.

       Christian

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @chleverenz 

     

    Thanks for your response. 🙂 Definitely I will share the QR generator and Scanning process which I used (although facing some issue in Iphone device).

    I was trying your mentioned approach by directly using liquid code but if I am passing the static id to the entity then it is working fine, but as you know I need to pass the id dynamically, So I was using a scanned content value which is a JS variable in place of static id.

    Static Id: Working fine and validation the record.

    {% assign populationid = entities.cre08_populationmaster['748a-248e-ea11-a811-00ab1893axyzxyz'] %}

     

    Dynamic ID: Using JS variable i.e scanned content. It's throwing liquid error

    {% assign populationid = entities.cre08_populationmaster[content] %}

     

    Could you please help me with how to use a dynamic value in liquid code. I know the other approach will be to create a web template and use that in page template and then finally a page which I will use in ajax call by passing the content variable as a parameter and get the response back from that page and use it.

     

    Thanks,

  • Verified answer
    Christian Leverenz Profile Picture
    1,214 on at

    Hi @Anonymous ,

    sorry for lkate answer, quite busy these days...

    i use as a webtemplae something like this:

    {% assign id = request.params['id'] %}
    {% if id %}
    {% assign myaccount = entities.account[id] %}
    {% endif %}
    {% if myaccount %}
    {
     "exists" : true,
     "fullname" : "{{ myaccount.name | escape }}"
    }
    {% else %}
    {
     "exists" : false
    }
    {% endif %}

    and set the content type as application/json (then it directly be viewd in the browser...)

    when i call https://xxxxxxx.microsoftcrmportals.com/en-US/check4account/?id=FE7B1259-605A-E511-80F2-3863BB365098 i might get

    {
     "exists" : true,
     "fullname" : "A. Datum Corporation (sample), , 78214 Redmond"
    }
    
    

    and if the account does not exists:

     

    {
     "exists" : false
    }

    Hope it helps,

      Christian

     

    PS request has a lot of useful attributes. check it out here: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects#request

     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 53

#1
rezarizvii Profile Picture

rezarizvii 53

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 24 Most Valuable Professional

Last 30 days Overall leaderboard