cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
emmebi
Frequent Visitor

NewForm - customizing submit

I have a NewForm submitting to a Dataverse table. How can I customize submit to save the attribute Office365Users.MyProfile().Mail to an email field in the table ? I do not want a DataCard in the form, I just want to save the authenticated user's Mail attribute when the submit button is pressed, together with the cards that are mapped to other fields in the Dataverse table

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @emmebi,

Do you want to patch the Mail to email filed in your Dataverse table but not with the submit action?

Could you please tell me that if the email field is a Text column in your Dataverse table?

Actually, if you want to patch the mail to the last submitted record, you could not put it with the SubmitForm() together.

As an alternative solution, please set the OnSuccess property of the Edit Form as below:

Patch(YourDataverseTable,EditForm1.LastSubmit,{EmailField:Office365Users.MyProfile().Mail})
Best Regards,
Qi

View solution in original post

6 REPLIES 6
Filistyn
Helper V
Helper V

Hey!

 

Have you tried  

 Collect(
        YourListName,
        {
            emailField: Office365Users.MyProfile().Mail});

 

also you can try it like this:

 Collect(
        YourListName,
        {
            emailField: User().Email});
v-qiaqi-msft
Community Support
Community Support

Hi @emmebi,

Do you want to patch the Mail to email filed in your Dataverse table but not with the submit action?

Could you please tell me that if the email field is a Text column in your Dataverse table?

Actually, if you want to patch the mail to the last submitted record, you could not put it with the SubmitForm() together.

As an alternative solution, please set the OnSuccess property of the Edit Form as below:

Patch(YourDataverseTable,EditForm1.LastSubmit,{EmailField:Office365Users.MyProfile().Mail})
Best Regards,
Qi

View solution in original post

emmebi
Frequent Visitor

I have tried to use:

SubmitForm(RequestAddNewForm);Collect('Requests',{Submitter:Office365Users.MyProfile().Mail})

in the OnSelect action of my submit button, but the Submitter field is not updated. I don't know if I can use SubmitForm and Collect together...

Hi @emmebi,

Collect() function is to create a collection rather than update the Dataverse table. The formula you tried makes no sense. 

The collection is a temporary table you saved on the device, but what you want is to update the data source.

Best Regards,
Qi

Hi Qi,

many thanks for your answer. The 'Submitter' field data type in my Dataverse for Teams table is Email (Text in email format).

Best,

emmebi

Dear Qi (@v-qiaqi-msft),

it works ! I had to delete the Submitter field and recreate it as a Text field: it seems that Email field type is read-only.

By the way, I am saving the user's email in my Dataverse table because I'm not able to retrieve it in a Power Automate flow, but that is another question...

Many thanks for your most precious support !

Best,

emmebi

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 (2,876)