cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tech08
Kudo Collector
Kudo Collector

Patch and flow for email not working together

On my ticket creation screen my submit button first creates a temp record to save the data, refreshes the data source, creates a ticket number with the max +1, submits all that, then it goes on to send emails.  Separately these work, but once I put the 2 halves together it constantly tells me the NewTechEm.Text is an invalid value for the parameter sendanemail2_to.  I've tried to do different ways to enter in the email, but no matter what I do it refuses to work.

 

Functional Part 1:

 

Set(temprecord,
Patch(Powerapp,Defaults(Powerapp),{
Status: NewStatus.Text,
Building: NewBuild.Selected.Value,
Room: NewRoom.Text,
Device: NewDevice.Selected.Value,
ProbCB: NewProbCB.Selected.Value,
ProbPC: NewProbPC.Selected.Value,
ProbIT: NewProbIT.Selected.Value,
ProbProj: NewProbProj.Selected.Value,
ProbSB: NewProbSB.Selected.Value,
ProbiPad: NewProbiPad.Selected.Value,
ProbOther: NewProbOther.Text,
Problem: NewProblem.Text,
StudentID: NewStuID.Text,
Destiny: NewDestiny.Text,
Cart: NewCart.Text,
Asset: NewAsset.Text,
BKCase: NewCBBKCase.Text,
BKKeyboard: NewCBBKKey.Text,
BKTouchpad: NewCBBKTouch.Text,
BKScreen: NewCBBKScr.Text,
BKOther: NewCBBKOther.Text,
Desciption: NewDesc.Text,
Creator: NewCreator.Text,
Created: NewCreated.Text}));
Patch(Powerapp,temprecord,{Ticket: Max(Powerapp,Ticket)+1});
UpdateContext({DateV: "",CaseV: "",KeyboardV: "",ScreenV: "",TouchpadV: ""});

 

Functional Part 2:

 

TicketCreated.Run(
NewCreator.Text,
NewCreated.Text,
NewBuild.Selected.Value,
If(IsBlank(NewRoom.Text),"",NewRoom.Text),
If(IsBlank(NewCart.Text),"",NewCart.Text),
If(IsBlank(NewStuID.Text),"",NewStuID.Text),
If(IsBlank(NewDestiny.Text),"",NewDestiny.Text),
If(IsBlank(NewAsset.Text),"",NewAsset.Text),
NewDevice.Selected.Value,
If(IsBlank(NewProblem.Text),"",NewProblem.Text),
If(IsBlank(NewDesc.Text),"",NewDesc.Text),
If(IsBlank(NewCBBKCase.Text),"",NewCBBKCase.Text),
If(IsBlank(NewCBBKKey.Text),"",NewCBBKKey.Text),
If(IsBlank(NewCBBKScr.Text),"",NewCBBKScr.Text),
If(IsBlank(NewCBBKTouch.Text),"",NewCBBKTouch.Text),
If(IsBlank(NewCBBKOther.Text),"",NewCBBKOther.Text),
NewBuild.Selected.Value,
Subject2.Text,
NewTechEm.Text);
Navigate(Home,ScreenTransition.None)

1 ACCEPTED SOLUTION

Accepted Solutions

I did finally get it working.  I had to use Updatecontext to make variables instead of reference the field value and do the flow after the item was submitted.  It seems to be working great.

 

If(!IsBlank(NewBuild.Selected.Value) && !IsBlank(NewDevice.Selected.Value) && !IsBlank(NewDesc.Text),
UpdateContext({NewProbV: NewProblem.Text,SubjectV: NewSubject.Text,NewEmailTechV: NewEmailTech.Text,NewDescV: NewDesc.Text,NewDestinyV: NewDestiny.Text,NewRmV: NewRoom.Text,NewStuIDV: NewStuID.Text,NewCartV: NewCart.Text,NewAssetV: NewAsset.Text,NewOtherV: NewOther.Text});
Set(temprecord,
Patch(Powerapp,Defaults(Powerapp),{
Status: "Open",
Building: NewBuildV,
Room: NewRmV,
Device: NewDeviceV,
Problem: NewProbV,
StudentID: NewStuIDV,
Destiny: NewDestinyV,
Cart: NewCartV,
Asset: NewAssetV,
BKCase: NewCaseV,
BKKeyboard: NewKeyboardV,
BKTouchpad: NewTouchpadV,
BKScreen: NewScreenV,
BKOther: NewOtherV,
Desciption: NewDescV,
Creator: User().Email,
Created: Now()}));
Refresh(Powerapp);
Patch(Powerapp,temprecord,{Ticket: Max(Powerapp,Ticket)+1});
UpdateContext({TicketV: Max(Powerapp,Ticket)});
EmailSubmitter.Run(
User().Email,
Now(),
NewBuildV,
If(IsBlank(NewRmV),"",NewRmV),
If(IsBlank(NewCartV),"",NewCartV),
If(IsBlank(NewStuIDV),"",NewStuIDV),
If(IsBlank(NewDestinyV),"",NewDestinyV),
If(IsBlank(NewAssetV),"",NewAssetV),
NewDeviceV,
NewProbV,
NewDescV,
If(IsBlank(NewCaseV),"",NewCaseV),
If(IsBlank(NewKeyboardV),"",NewKeyboardV),
If(IsBlank(NewScreenV),"",NewScreenV),
If(IsBlank(NewTouchpadV),"",NewTouchpadV),
If(IsBlank(NewOtherV),"",NewOtherV),
NewBuildV,
SubjectV,
NewEmailTechV,TicketV);
UpdateContext({NewBuildV: "",NewRmV: "",NewProbV: "",NewDeviceV: "",NewStuIDV: "",NewDestinyV: "",NewCartV: "",NewAssetV: "",NewCaseV: "",NewKeyboardV: "",NewScreenV: "",NewTouchpadV: "",NewOtherV: "",NewDescV: "",NewEmailTechV: "",NewSubjectV: ""});
Navigate(Home,ScreenTransition.None))

View solution in original post

2 REPLIES 2
v-micsh-msft
Community Support
Community Support

Hi @Tech08,

 

Just from the error message:

"NewTechEm.Text is an invalid value for the parameter sendanemail2_to. "

The problem here should be mostly related with the string in NewTechEm.Text. If this field is used as the Email To field, then please make sure it matches the Email format.

The Email format should be separated by semicolons like someone@contoso.com;someone@company.com

Further, have you modified the Flow before? If yes, then take a try to delete the Flow connection, then add the flow again to check.

On new configuration, please make sure the field are properly matched.

If convenient, please also share a screenshot of the Flow configuration, which should be helpful to narrow down the cause.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I did finally get it working.  I had to use Updatecontext to make variables instead of reference the field value and do the flow after the item was submitted.  It seems to be working great.

 

If(!IsBlank(NewBuild.Selected.Value) && !IsBlank(NewDevice.Selected.Value) && !IsBlank(NewDesc.Text),
UpdateContext({NewProbV: NewProblem.Text,SubjectV: NewSubject.Text,NewEmailTechV: NewEmailTech.Text,NewDescV: NewDesc.Text,NewDestinyV: NewDestiny.Text,NewRmV: NewRoom.Text,NewStuIDV: NewStuID.Text,NewCartV: NewCart.Text,NewAssetV: NewAsset.Text,NewOtherV: NewOther.Text});
Set(temprecord,
Patch(Powerapp,Defaults(Powerapp),{
Status: "Open",
Building: NewBuildV,
Room: NewRmV,
Device: NewDeviceV,
Problem: NewProbV,
StudentID: NewStuIDV,
Destiny: NewDestinyV,
Cart: NewCartV,
Asset: NewAssetV,
BKCase: NewCaseV,
BKKeyboard: NewKeyboardV,
BKTouchpad: NewTouchpadV,
BKScreen: NewScreenV,
BKOther: NewOtherV,
Desciption: NewDescV,
Creator: User().Email,
Created: Now()}));
Refresh(Powerapp);
Patch(Powerapp,temprecord,{Ticket: Max(Powerapp,Ticket)+1});
UpdateContext({TicketV: Max(Powerapp,Ticket)});
EmailSubmitter.Run(
User().Email,
Now(),
NewBuildV,
If(IsBlank(NewRmV),"",NewRmV),
If(IsBlank(NewCartV),"",NewCartV),
If(IsBlank(NewStuIDV),"",NewStuIDV),
If(IsBlank(NewDestinyV),"",NewDestinyV),
If(IsBlank(NewAssetV),"",NewAssetV),
NewDeviceV,
NewProbV,
NewDescV,
If(IsBlank(NewCaseV),"",NewCaseV),
If(IsBlank(NewKeyboardV),"",NewKeyboardV),
If(IsBlank(NewScreenV),"",NewScreenV),
If(IsBlank(NewTouchpadV),"",NewTouchpadV),
If(IsBlank(NewOtherV),"",NewOtherV),
NewBuildV,
SubjectV,
NewEmailTechV,TicketV);
UpdateContext({NewBuildV: "",NewRmV: "",NewProbV: "",NewDeviceV: "",NewStuIDV: "",NewDestinyV: "",NewCartV: "",NewAssetV: "",NewCaseV: "",NewKeyboardV: "",NewScreenV: "",NewTouchpadV: "",NewOtherV: "",NewDescV: "",NewEmailTechV: "",NewSubjectV: ""});
Navigate(Home,ScreenTransition.None))

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,403)