cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Tech08
Level: Powered On

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
Tech08
Level: Powered On

Re: Patch and flow for email not working together

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
Community Support Team
Community Support Team

Re: Patch and flow for email not working together

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.
Tech08
Level: Powered On

Re: Patch and flow for email not working together

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 145 members 5,128 guests
Please welcome our newest community members: