cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jandersen
Frequent Visitor

Use alternate key instead of GUID in query string

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!

8 REPLIES 8
OliverRodrigues
Super User II
Super User II

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.




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.

Power Apps Portals Super User


Oliver Rodrigues


 

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..

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.




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.

Power Apps Portals Super User


Oliver Rodrigues


 

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?

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)




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.

Power Apps Portals Super User


Oliver Rodrigues


 

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?

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%20befor....

 

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 




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.

Power Apps Portals Super User


Oliver Rodrigues


 

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. 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Users online (49,534)