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)
Solved! Go to Solution.
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))
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
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))
User | Count |
---|---|
259 | |
110 | |
97 | |
57 | |
39 |