cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

DataEntity Type

Hi, 

 

I am wondering if anybody has come across this error before and knows where i am going wrong? see Capture. 

 

I am trying to insert a new record into a CDS 2.0 Entity that has a n:1 Relationship, no matter what i try to referrence the LookUp Record it always comes up with the attached error. 

 

I have tried a LookUp to the record directly, as well as creating a temp collection of the record, i have also tried referencing the Required Name field as well as the Guid. 

 

ClearCollect(
    Accessibility,
{cl_accessibilityoptionsid:Blank(),
cl_StaffDetails:MyStaffDetails.StaffId,
cl_displayname:MyUserDisplayName,
cl_userid:MyStaffID,
cl_fadelevel:AS_Transparency_sli.Value,
cl_screencolour:ScreenColour,
cl_defaultfilter: AS_DefaultFilter_tgl.Value,
cl_red:R,
cl_green:G,
cl_blue:B
}
);
Set(As_Options, "Your Options have been Saved");
UpdateContext({AS_OptionsSaved:true});
Collect(AccessibilityOptions, Accessibility));

The LookUp field is cl_StaffDetails, MyStaffDetails is a local collection and StaffId is the Guid.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you want to insert a new record into your CDS entity using Collect function?

 

The error message told that the 'cl_StaffDetails' column is required to provide a DataEntity type value, but you provided a Text type value.

 

I have made a test, and the issue is confirmed on my side. There is no way to provided a DataEntity type value for a Lookup type column of CDS entity within PowerApps currently, I afraid that there is no way to add new record into a CDS Entity which contains a Lookup column using Collect function.

 

If you would like this feature to be added into PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider take a try to generate an app from your CDS entity, and then save your data into your CDS entity via clicking the "Submit" button within the Edit screen.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you want to insert a new record into your CDS entity using Collect function?

 

The error message told that the 'cl_StaffDetails' column is required to provide a DataEntity type value, but you provided a Text type value.

 

I have made a test, and the issue is confirmed on my side. There is no way to provided a DataEntity type value for a Lookup type column of CDS entity within PowerApps currently, I afraid that there is no way to add new record into a CDS Entity which contains a Lookup column using Collect function.

 

If you would like this feature to be added into PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider take a try to generate an app from your CDS entity, and then save your data into your CDS entity via clicking the "Submit" button within the Edit screen.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Hi @v-xida-msft

 

Thank you for the response, i think i have wasted around 2 days trying every different scenario i could think off to get this to work. I have submitted an idea to have it added. 

 

Unfortunately recreating the app would not really be practical in this case as it is currently in a trial period with some of our services. With new items been added to it constantly. 

 

I already do have a work around as this was started prior to relationships been available in 2.0 i insert the Guid as a string to create my own relationships between the entities, the main problems around this has been delegation. 

 

Thanks

Craig

John_P
Frequent Visitor

I have added a vote to your idea (link: https://powerusers.microsoft.com/t5/PowerApps-Ideas/option-to-insert-a-new-record-to-CDS-with-Relati... for other people having the same issue).

 

Although I'm new to PowerApps, I wanted to build some offline functionality in from the start, so I figured I'd just collect data from the CDS and then patch new records into it, but I hit the same issue of not being able to set a lookup value into CDS.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,339)