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
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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (2,445)