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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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