Hi everyone,
I am new in Power Apps, I need your help please.
Scenario:
My wish
1. Use a button
I have been trying to this out:
SubmitForm(Form1);
MicrosoftTeams.CreateChat(
DataCardValue1.Selected.Email, {
content: Concatenate(
"A new item has been created with the following details: ", RecordGallery1.'Nr.' & RecordGallery1.Selected.'Country' & RecordGallery1.Selected.'Customer' & RecordGallery1.Selected.'Weight' & " is completed."
),
contentType: 0
}
)
SubmitForm(Form1);
MicrosoftTeams.CreateChat(
DataCardValue1.Selected.Email, {
content: Concatenate(
"A new item has been created with the following details: ", RecordGallery1.'Nr.' & RecordGallery1.Selected.'Country' & RecordGallery1.Selected.'Customer' & RecordGallery1.Selected.'Weight' & " is completed"
),
contentType: 0
}
)
Please any help or suggestion is appreciated @WarrenBelz
This is not working for me, is there anything special that needs to be configured between PowerApps and Teams?
Thanks so much @Anchov
I am getting error but I would use the power automate solution . I appreciate your effort. Thanks once again.
Ok a few things that I see:
1. When you select an item RecordGallery1, a variable is getting created that stores your selected record. Whenever you save this record, you want to update this variable so you get the most current results in the variable. The best place to do this would be in the OnSuccess property of you form and the formula to update would look like something like this:
UpdateContext({CurrentItem: Self.LastSubmit})
It looks like you are using the new Microsoft canvas app template (auto generation of an app), so this is already likely there.
2. In your custom button, I don't think your need to perform another SubmitForm(Form1) action, as you are already submitting the ✅ icon in your form and this seems redundant from what I see. I would remove this.
3. Since you are already saving the newest record information in the CurrentItem Variable, you will want to use this variable instead of trying to reference your gallery selected item. So you would re-write your Team Chat formula to something like:
MicrosoftTeams.CreateChat(
//Not sure if DataCarValue1.Selected.Email is in relation to your form, but assuming your have a Column called Email in your SharePoint list, this is what you use. If not it might be something like CurrentItem.PersonField.Email
CurrentItem.Email, {
content: Concatenate(
"A new item has been created with the following details: ", CurrentItem.'Nr.' & CurrentItem.'Country' & CurrentItem.'Customer' & CurrentItem.'Weight' & " is completed."
),
contentType: 0
}
)
I tried testing this, but I was not able to get a teams message sent in my environment (but no error). If you have no luck with this, you might try using power automate, see this thread:
Solved: Powerapp create Microsoft team chat - Power Platform Community
Another option:
Microsoft Teams messages from Power Apps - 365 Corner
Edit:
I did get the Create Chat to work, but I had to use this syntax:
MicrosoftTeams.CreateChat("AdeleV@0v42t.onmicrosoft.com", {topic: $"topic: {CurrentItem.Coat}"})
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Cheers!
Rick Hurt
"RecordGallery1" is the Gallery that populates the items in the sharepoin list and shows items when selected.
OnSelect:
UpdateContext({ itemSelected: true, CurrentItem: ThisItem })
Item:
If(IsBlank(SearchInput1.Text),
Demo,
Filter(Demo,
Or(StartsWith(Nr.,SearchInput1.Text), StartsWith(Customer, SearchInput1), StartsWith(Land.Value, SearchInput1))))
The button is located outside the form and outside the gallery . The button is meant to be used for the final submission
the Icon check is used for saving and submitting the form (inbetween: thats is during filling of form, if the whole fields are not yet filled ) .
Thanks for your help
For clarification, "Record1Gallery1" is different that the gallery name you have in your script "RecordGallery1".
How is RecordGallery1 being populated? Is this gallery related to your form at all? Where is the button located, is it in the gallery or out side the gallery?
Hi @Anchov ,
The
RecordGallery1.'Nr.' & RecordGallery1.Selected.'Country' & RecordGallery1.Selected.'Customer' & RecordGallery1.Selected.'Weight' & " is completed
part show error : "Name isn't valid. Record1Gallery1 isn't recogniszed".
I think the problem is the concatenation. It cant excute or run that part. Thanks
What specific issue are you encountering? Is the chat not posting, or is it posting, but the values you expect are not appearing? Are you receiving any error messages? My hunch is that you are submitting your form successfully, and then the form is getting reset, causing your expected values that you want to appear in the chat to get nulled out. Any additional information or screenshots would be helpful.
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Cheers!
Rick Hurt