Skip to main content
Community site session details

Community site session details

Session Id : ByVSaLjuPo5MOzoKvgFYt1
Power Apps - Building Power Apps
Answered

Copying data to SharePoint List

Like (0) ShareShare
ReportReport
Posted on 28 Feb 2024 05:44:24 by 14

Hello everybody

 

I have this code, which works very well, but I would also like to copy the same data to another SharePoint list by adding the timestamp. How can this be achieved? 

 

    If(Value(DataCardValue34.Text)<Value(DataCardValue31.Text);

            Office365Outlook.SendEmailV2("xx.xx@xxxx.com";

                                "Commande consommable labo à réaliser";

                                Concatenate("Article : "&DataCardValue26.Text & "<br>";

                                "Référence : "&DataCardValue27.Text & "<br>";

                                "Fournisseur : "&DataCardValue9.Text & "<br>";

                                "Stock : " & (Value(DataCardValue34.Text) - Value(QuantitéSortie.Text) + Value(QuantitéEntrée.Text))));;

            Navigate(BeginScreen1; ScreenTransition.None);

        Navigate(BeginScreen1; ScreenTransition.None))

Thank you for your ideas and solutions

 

M@x

Categories:
  • Muzomax59 Profile Picture
    14 on 28 Feb 2024 at 09:44:32
    Re: Copying data to SharePoint List

    Ok it's good

     

    Thanks

  • Verified answer
    SpongYe Profile Picture
    5,580 Super User 2025 Season 2 on 28 Feb 2024 at 07:28:39
    Re: Copying data to SharePoint List

    Hi @Muzomax59 

     

    Assuming that the Sharepoint list has the same columns I would have done something like this.

    Adding the patch under the SendMail function:

     Patch(
     SharePointList, // Replace with your SharePointlist
     Defaults(SharePointList), 
     {
     Article: DataCardValue26.Text,
     Référence: DataCardValue27.Text,
     Fournisseur: DataCardValue9.Text,
     Stock: (Value(DataCardValue34.Text) - Value(QuantitéSortie.Text) + Value(QuantitéEntrée.Text)),
     Submission_Time: Now() // Add the current timestamp
     }
     );

     You can create a new column of type Date & Time (let’s call it "Submission_Time") in your sharepoint list.

     

    Your code would look like:

    If(
     Value(DataCardValue34.Text) < Value(DataCardValue31.Text),
     Office365Outlook.SendEmailV2(
     "xx.xx@xxxx.com",
     "Commande consommable labo à réaliser",
     Concatenate(
     "Article: " & DataCardValue26.Text & "<br>",
     "Référence: " & DataCardValue27.Text & "<br>",
     "Fournisseur: " & DataCardValue9.Text & "<br>",
     "Stock: " & (Value(DataCardValue34.Text) - Value(QuantitéSortie.Text) + Value(QuantitéEntrée.Text))
     )
     );
     Patch(
     SharePointList,
     Defaults(SharePointList),
     {
     Article: DataCardValue26.Text,
     Référence: DataCardValue27.Text,
     Fournisseur: DataCardValue9.Text,
     Stock: (Value(DataCardValue34.Text) - Value(QuantitéSortie.Text) + Value(QuantitéEntrée.Text)),
     Submission_Time: Now() 
     }
     );
     Navigate(BeginScreen1; ScreenTransition.None);
     Navigate(BeginScreen1; ScreenTransition.None)
    )
    

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2