cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chris61
Level: Powered On

Patching a LookUp field: The right side of the Equal operator must be a constant value

As the title says I am patching a LookUp field in CDS. I have not had a problem with this before.

 

1) I am creating an offline collection which collects some details for a new record plus the GUID of a related entity and the GUID for another related entity.

 

2) The first LookUp to be patched works. I create a GUID on the device for the related entity. Upload the related record first with the GUID then do a patch for the next entity and relate it with the GUID:

 

Shift: LookUp(Choices('Shift Activities'.Shifts), UID=new_shiftGUID)

 

3) Then the other related entity already has a record in the system so I get the system generated GUID

 

4) Within the same patch I try to update the LookUp field for this second related entity:

 

Campaign: LookUp(Choices('Shift Activities'.Campaigns), Campaign=new_campaignid)

 

5) While the record is patched, it does not complete the Campaign LookUp field. Instead, using monitor I get the following error:

 

"message": "The right side of the \"Equal\" operator must be a constant value."
 
6) If I put the field value in a text box with this formula:
First(colOfflineShiftCollection).new_campaignid
 
7) Then do another text box to Look Up the campaign based on the string:
LookUp(Campaigns, Campaign=GUID(Label26.Text)).Name

 

😎 It works and I can reference the Campaign

 

9) Similarly, if I patch the LookUp field using the value from the text box the Patch works fully!

 

10) What is going on? Why can't I patch this LookUp field?

3 REPLIES 3
chris61
Level: Powered On

Re: Patching a LookUp field: The right side of the Equal operator must be a constant value

Some additional information:

 

When looking at monitor, the request is the following:

 

Ashish2012
Level 8

Re: Patching a LookUp field: The right side of the Equal operator must be a constant value

chris61
Level: Powered On

Re: Patching a LookUp field: The right side of the Equal operator must be a constant value

Sorry I'm not sure what you mean by your reply. If you are suggesting that the second URL is the correct one then yes I agree, this is my point. PowerApps is not constructing the URL in this way, it is constructing the first one. I don't know why it is doing this and I can't see a way around it and so I am getting the problem I initially posted about.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,041)