cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Am4ree
Helper I
Helper I

Get value from SP list that we just Inserted

Hello Community,

 

How do we get the value from SP list that we just inserted by Patch and get it for send email?

 

I have button Reject OnSelect

Am4ree_0-1659582572155.png

Am4ree_1-1659582679653.png

Results

Am4ree_3-1659582856866.png

Currently I'm missing Manager Rejected Date that I just inserted. in SP List, the value of Rejected date has created but I can't get it to send email.

 

anyone able to help?

 

appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Am4ree,

Have you solved your problem?

Do you want to get the last updated record after you save it?

 

Actually, I think you could reference to the Modified column in your List to capture the latest record.

Office365Outlook.SendEmailV2(
    "QiQiao@xxxx.onmicrosoft.com",
    "HolaWorld",
    "Date" & First(
        Sort(
            BU,//This is my data source
            Modified,
            Descending
        )
    ).Modified
)

vqiaqimsft_0-1660032806495.png

 

Best Regards,
Qi

View solution in original post

5 REPLIES 5
metsshan
Solution Sage
Solution Sage

Good news!! Patch actually returns exactly what you are looking for, you just need to capture it in a variable using Set() or UpdateContext(). Eg:

UpdateContext({SubmittedRecord: Patch('ASCIS PR Tracking', {ID: 1}, {Comments: "Updated record!!"})})

Then you can reference SubmittedRecord like any other.

 

https://docs.microsoft.com/en-us/power-platform/power-fx/reference/function-patch 

metsshan_0-1659590742534.png

 

Hi @metsshan 

 

Great, Let me try it. Once there is issue I'll post update in here.

 

Thanks

Am4ree
Helper I
Helper I

Hi @metsshan 

 

Unfortunately I still can't get the return value when received email. here look like after implement update context().

I still missing 'Manager Approved Date' and Comments value but Patch has successfully updated in SP.

Am4ree_0-1659608466505.png

Rejected Date - Comments Value in SP

Am4ree_1-1659608640133.png

 

 

Hi @Am4ree,

Have you solved your problem?

Do you want to get the last updated record after you save it?

 

Actually, I think you could reference to the Modified column in your List to capture the latest record.

Office365Outlook.SendEmailV2(
    "QiQiao@xxxx.onmicrosoft.com",
    "HolaWorld",
    "Date" & First(
        Sort(
            BU,//This is my data source
            Modified,
            Descending
        )
    ).Modified
)

vqiaqimsft_0-1660032806495.png

 

Best Regards,
Qi

Hi @v-qiaqi-msft ,

 

Theoretically Yes, I just want to get return value that I have patch function on Rejected Button.

When Rejected Button Pressed - it will patch state from submitted to Rejected and insert new value on 'Manager Rejected Date'  (Date) and 'Comments' (Text Input) Column in SP.   and Send email to recipient to including new value that I had inserted before.

Am4ree_0-1660115464954.png

Am4ree_2-1660117168276.png

 

but I still can't get new value when received email

Am4ree_3-1660117272846.png

 

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,339)