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
Ok it's good
Thanks
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! 🍻