Hello All
I am so close to finishing out a project, and would appreaciate a little help.
I have a lookup field, which references a Gallery of all Campaigns in D365, this is called Campaign_BCR
LookUp(Campaigns,name=BrowseGallery3_1.Selected.name,name)
I also have a Patch function which looks to patch the First Name, Last Name and Campaign I have chosen to the Lead entity, which works fine if it is just First Name and Last Name, but when I look to Patch the Campaign to the Lead I get an error
Patch(Leads,Defaults(Leads),{firstname:FirstName_BCR.Text,lastname:LastName_BCR.Text,campaignid:Campaign_BCR.Selected.campaignid})
To confirm the schema of the lookup field on the lead to the campaign is campaignid
Here is the error message I am getting.
The type of this argument campaginid does not match the expected record type 'Record'
Any and all advice greatfully recieved.
Thanks in advance
Lee
Solved! Go to Solution.
Thanks for taking the time, I managed to solve it in the end and got it working using the following, I have no idea what the difference is, but this worked for me patching a lookup
_campaignid_value: CampaignGallery.Selected.campaignid
Hi @Mr_Mather
Hello there
Unfortunatley that did not work, I get the same error message
Lee
Hi @Mr_Mather
Campign_BCR is a lookup field that references the Gallery, which I have renamed for clarity to be CampaignGallery
LookUp(Campaigns,name=CampaignGallery.Selected.name,name)
So I changed the Patch to reference the gallery instead
Patch(Leads,Defaults(Leads),{firstname:FirstName_BCR.Text,lastname:LastName_BCR.Text,campaignid:CampaignGallery.Selected})
And I got a new error this time
The requested operation is invalid. Server Response: A value must be provided for item
I am using the Dynamics connector not the Common Data Service connection
Thanks for all the help so far
Hey @Mr_Mather
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Firstly, thanks ever so much for the time you are taking on this.
To answer your questions -
Here are my data sets, there are two environments I am looking at, a Development and a Staging. The Staging environment has the _1 at the end of the name and it is this environment I am currently pointing everything to.
Yes, I am pointing the Gallery Control to the Campaigns_1 table in the staging environment. The Gallery is called CampaignGallery.
SortByColumns(Search(Campaigns_1, CampaignSearch_CS.Text,"name"), "name", If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))
The following is my patch lines
Patch( Leads_1, Defaults(Leads_1), { subject: "Tradeshow App Generated", firstname: FirstName_BCR.Text, lastname: LastName_BCR.Text, campaign_1: CampaignGallery.Selected.campaign_1 } )
With this I get the error that Campaign_1 is not a field in the table, so I change it to the following
campaignid: CampaignGallery.Selected.campaign_1
campaignid is the schema name for the lookup column in the Leads_1 table, however when I change it to this I get the following error
The type of argument 'campaignid' does not match the expected type 'Record'. Found type 'Error'.
I get a different error when I link it to Campainid at the end
campaignid: CampaignGallery.Selected.campaignid
here i get the error
The type of argument 'campaignid' does not match the expected type 'Record'. Found type 'Guid'.
so I assuming that whatever is at the end of that line needs to be the type of record.
here is the solution line for the campaign lookup on the lead entity
Thanks for taking the time, I managed to solve it in the end and got it working using the following, I have no idea what the difference is, but this worked for me patching a lookup
_campaignid_value: CampaignGallery.Selected.campaignid
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
205 | |
187 | |
82 | |
50 | |
37 |
User | Count |
---|---|
288 | |
244 | |
123 | |
75 | |
56 |