Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Copying data to SharePoint List

(0) ShareShare
ReportReport
Posted on 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
    Muzomax59 14 on at
    Re: Copying data to SharePoint List

    Ok it's good

     

    Thanks

  • Verified answer
    SpongYe Profile Picture
    SpongYe 5,411 on at
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard