cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bfausti
Helper I
Helper I

Using GUID to lookup records from query string.

I am trying to return a record from CDS from my Canvas App using the GUID. However, it returns null records when using the following formulas:

 

Set(varCreditId,Value(Param(“creditId”));

Set(varRecord,Lookup(Credits, ‘Credit GUID’ = GUID(Text(varCreditId))))

 

Any help with my formula would be much appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User III
Super User III

Hi @bfausti 

What value are you passing in Param("creditId")?

If it's a proper GUID in a format that looks like this (58103cdb-f4ef-4a70-9183-d942a9232777), calling Value on this input will result in blank as it's not a valid number.

Therefore, you might have more success with this.

Set(varCreditId,Param("creditId"));
Set(varRecord,Lookup(Credits, 'Credit GUID' = GUID(Text(varCreditId))))

 

View solution in original post

4 REPLIES 4
timl
Super User III
Super User III

Hi @bfausti 

What value are you passing in Param("creditId")?

If it's a proper GUID in a format that looks like this (58103cdb-f4ef-4a70-9183-d942a9232777), calling Value on this input will result in blank as it's not a valid number.

Therefore, you might have more success with this.

Set(varCreditId,Param("creditId"));
Set(varRecord,Lookup(Credits, 'Credit GUID' = GUID(Text(varCreditId))))

 

View solution in original post

v-xiaochen-msft
Community Support
Community Support

Hi @bfausti ,

 

I did a test for you and did not encounter your problem.

1\ Set the onstart property to:

Set(Thevar1,Param("testname"));Set(Thevar2,LookUp('Test 101S','Test 101'=GUID(Thevar1)))

 

2\ Add a label control and set its Text property to:

Thevar2.Name

 

3\ Copy my app URL.

 

4\ Copy one record's GUID value in 'Test 101S' table.

4db867b2-009c-eb11-b1ac-000d3a80a818

 

5\ Enter the URL through the browser and access it

v-xiaochen-msft_0-1618305816588.png

// URL&testname=****

 

6\ The result is as follows:

v-xiaochen-msft_1-1618305859022.png

v-xiaochen-msft_2-1618305924233.png

 

Please check if your steps are different from mine.

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

Hi @timl, yes I am passing a proper GUID. Thanks for the tip. I will update my formula and I’m sure this will work. Thanks again. 

timl
Super User III
Super User III

You're welcome @bfausti, glad to help.

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

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

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

Top Solution Authors
Top Kudoed Authors
Users online (93,128)