cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GrifoDeGrifis
Regular Visitor

Submit Form based on dataverse table with Polymorphic field owner

Hi All,

I've created a form based on a dataverse table with User/Team ownership.

In such table only 3 fields are required:

  • ID
  • Status
  • Owner

When adding those 3 field to the form I can see values for the first 2, not for the Owner field.

Trying to submit the form (after modifying an existing record) I get a generic failure message.

 

An entry is required or has an invalid value. Please correct and try again

 

I have the suspect that the form doesn't provide data for updating the Owner field, and this led me to study those Polymorphic fields.

After reading this, that and another post, I understood how to show the Owner of this field in the form datacard (although this was not my goal). But I'm still having problem updating that field.

 

so my question is, if a record already has an owner, do I still need to Update it? how can I do that? do I need to use Patch or can I write it in the Update property to make it work along with SubmitForm(...)?

In this case for me the owner should be automatically picked up based on User().Email

 

 

 

Bonus question, when creating a new record in this table, will I also have to generate the ID or dataverse will still take care of it?
on the same topic, will I have to figure out how to provide an "Active" value for the Status field too?

 

 

Thank you in advance for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
GrifoDeGrifis
Regular Visitor

I found the solution in the end, sharing here should anybody need it in the future:

 

You don't need to update the field, if not included in the loaded fields of the form, Dataverse in the background will take care of adding owner, status, and the ID (if properly set on Dataverse side). So simply exclude those fields from the form and the system will take care of them.

But at first I didn't have those fields and yet could not save the form.

It was in the end because of another field, a lookup field that describes the relationship with another table. Once I took care of filling out that field automatically in the background (not visible data-card), it worked properly, but those 3 fields were still included, hence the error that I was encountering.

This also answer to my "bonus question", yes, PowerApps and Dataverse take care of filling out those fields also when creating a new item.

View solution in original post

2 REPLIES 2
GrifoDeGrifis
Regular Visitor

Monday uppity!

GrifoDeGrifis
Regular Visitor

I found the solution in the end, sharing here should anybody need it in the future:

 

You don't need to update the field, if not included in the loaded fields of the form, Dataverse in the background will take care of adding owner, status, and the ID (if properly set on Dataverse side). So simply exclude those fields from the form and the system will take care of them.

But at first I didn't have those fields and yet could not save the form.

It was in the end because of another field, a lookup field that describes the relationship with another table. Once I took care of filling out that field automatically in the background (not visible data-card), it worked properly, but those 3 fields were still included, hence the error that I was encountering.

This also answer to my "bonus question", yes, PowerApps and Dataverse take care of filling out those fields also when creating a new item.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,664)