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

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
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!

Users online (1,659)