Good evenings
Could you again please help me with my powerapps issue ?.
I got two buttons one for saves as draft and the other one for final submit
I would like to generate reference no
At the moment with my formula it only generates ref no when someone first clicks on save as draft and goes back selects the item from gallery and clicks on final submit
When they click on save as draft only ,Ref no field is empty but all the other data submitted. Similarly when they click on final submit Ref no field is empty but all the other data submitted
Formula on Save as draft button On Select:
SubmitForm(Form1);If(Form1.LastSubmit.RefNo=Blank() And DataCardValue8.Selected.Value="A and B ", Patch(FCOG,Form1.LastSubmit,{Status:"Draft", RefNo: Concatenate(Text(DataCardValue11.SelectedDate,"ddmmyyyy"),"-", ddBusinessArea.Selected.Value,"-",Text(Form1.LastSubmit.ID))}), Patch(MyForm,Form1.LastSubmit,{Status:"Draft"}));Navigate(Home,ScreenTransition.Cover)
Formula on Final submit button On Select:
SubmitForm(Form1); If(Form1.LastSubmit.RefNo=Blank() And DataCardValue8.Selected.Value="A and B", Patch(FCOG,Form1.LastSubmit,{Status:"Final", RefNo: Concatenate(Text(DataCardValue11.SelectedDate,"ddmmyyyy"),"-", ddBusinessArea.Selected.Value,"-",Text(Form1.LastSubmit.ID))}), Patch(MyForm,Form1.LastSubmit,{Status:"Final"}));Navigate(Home,ScreenTransition.Cover)
Any help would be appreciated
Solved! Go to Solution.
@ezi79 Please update your code like this,
In the OnSelect of the Save as draft button,
UpdateContext({ctxSaveAs:"Draft"});
SubmitForm(Form1)
In the OnSelect of the Final submit button,
UpdateContext({ctxSaveAs:"Final"});
SubmitForm(Form1)
In the OnSuccess of Form1,
If(Form1.LastSubmit.RefNo=Blank() And DataCardValue8.Selected.Value="A and B ", Patch(FCOG,Form1.LastSubmit,{Status:ctxSaveAs, RefNo: Concatenate(Text(DataCardValue11.SelectedDate,"ddmmyyyy"),"-", ddBusinessArea.Selected.Value,"-",Text(Form1.LastSubmit.ID))}), Patch(MyForm,Form1.LastSubmit,{Status:ctxSaveAs}));
Navigate(Home,ScreenTransition.Cover)
Hello @ezi79
Which data source are you using?
Proud to be a Flownaut!
@ezi79 Please update your code like this,
In the OnSelect of the Save as draft button,
UpdateContext({ctxSaveAs:"Draft"});
SubmitForm(Form1)
In the OnSelect of the Final submit button,
UpdateContext({ctxSaveAs:"Final"});
SubmitForm(Form1)
In the OnSuccess of Form1,
If(Form1.LastSubmit.RefNo=Blank() And DataCardValue8.Selected.Value="A and B ", Patch(FCOG,Form1.LastSubmit,{Status:ctxSaveAs, RefNo: Concatenate(Text(DataCardValue11.SelectedDate,"ddmmyyyy"),"-", ddBusinessArea.Selected.Value,"-",Text(Form1.LastSubmit.ID))}), Patch(MyForm,Form1.LastSubmit,{Status:ctxSaveAs}));
Navigate(Home,ScreenTransition.Cover)
This is great .It is now working thank you so much , have a lovely weekend
Hi again
I am not sure what is going on with this form but it does not generate ref no now on save as draft button and final submit button ,It only generates when someone save as draft first and select the item from the gallery to edit and clicks on final submit
Any ideas why it is not working ?, I have not change anything on the code.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
190 | |
53 | |
51 | |
34 | |
33 |
User | Count |
---|---|
268 | |
91 | |
80 | |
68 | |
67 |