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 / Use alternate key inst...
Power Pages
Unanswered

Use alternate key instead of GUID in query string

(1) ShareShare
ReportReport
Posted on by 22

Hello all,

 

I have a web form with an edit form that has Record Source Type Query String. The URL contains the GUID of the CDS record that a user should edit, like so:

 

website.com/webform/?id=5b99bde5-99fe-ea11-b5d9-281878975931

 

Is there a way to use an alternate key instead of the GUID of the record? In the entity I want to edit I have a custom, unique ID per record. I would like to use this ID instead of the automatically generated GUID. But setting my own ID up as an alternate key and using it insetad of the GUID in the URL returns the error "The record you are looking for couldn't be found."

 

Thanks for any hints!

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi

     

    The OOB Portal configuration would required this to be the record GUID.

     

    Is there any specific reason you would prefer this to be your own ID?

     

    you could achieve this by maybe with an intermediate page, reading your query string parameter - fetching your entity to get the record guid - finally redirecting to the expected page with the GUID

    that solution you would be performing an additional Retrieve + Redirect, so it's not really ideal 


    ------------

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

  • jandersen Profile Picture
    22 on at

    Hi Oliver, thanks for the input. The reason I want this is because the record GUIDs are too similar.

    For example, these two GUIDs of mine are only different in the second character:

     

    bf274d1b-34f8-ea11-a815-000d3ab005c4

    be274d1b-34f8-ea11-a815-000d3ab005c4

     

    a person who understands this could just replace this character and see data that they should not see. I'd rather use some hash value I generated by myself instead of the GUID..

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    okay I see your issue now, actually the chances of someone getting right a different valid GUID are very little

    and even if they do, your Portals should have security preventing the users from seeing data they shouldn't

     

    have you implemented Entity Permissions in your Portals? https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/assign-entity-permissions

     

    ------------

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

  • jandersen Profile Picture
    22 on at

    I would like to do it without requriing a user to sign in.  Do you know if a record GUID can be defined or changed manually?

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    any reasons for not having users logging in? my initial guess is licensing - and if it is, I can't blame you

     

    you can actually define the record GUID at the creation moment, but this is if you are creating the record programmatically.. I am not sure you can add a plug-in on the pre-create to change this (haven't done myself but worth a try)

  • jandersen Profile Picture
    22 on at

    It's not so much licensing thats the issue, since my emplyoer pays for the license, but rather simplicity :).

     

    I basically want people to check if their contact data is up to date. So I want to give all these people a personal link which they can use to check their contact data in a Web Form. I could create a Contact entity record for each person and  then control visibility via entity permissions. But that would require my users to go through the process of signing up via an invitation. Since most of them will only use the form once I would prefer no to ask them do do that.

     

    Do you know of any resources that explain how to define a record GUID?

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    how familiar are you with c# and D365 plugins? 

     

    there are several articles online you can find on that, but you need to be familiar with Visual Studio / C# / D365 development .. etc

     

    the idea I would propose is that on the Create message / pre-operation pipeline you set the id attribute with a new Guid() .. but again, not sure that would work

     

    https://carldesouza.com/dynamics-365-pre-operation-plugin/#:~:text=These%20plugins%20execute%20before%20the,this%20in%20pre%2Dvalidation).

     

    and sorry to insist, but be aware of data protection here.. as much random you can generate an ID, the data is still not properly protected. I would highly recommend forcing users to sign-in first 

  • jandersen Profile Picture
    22 on at

    Thanks for the links. I'll look into them but I fear I'm not familiar enough with the plugins you mentioned.

     

    About the data protection i'lll have to run this by our data protection team for sure.. And as we're in the EU i think the risk is high that it won't fly - but I can always fall back to the sign-in option if it's rejected. Good that you're hammering this point home.. it's why i'm so concerned about randomizing the GUIDs.

     

    I'm probably just going to create a lot of placeholder records and randomize them, and fill them with data later. That way the individual GUIDs will be less similar to each other than when I create new record by bulk importing data. 

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
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard