I have 2 forms in my PowerApps.
1. Main Form
2. Sub Form
The idea of the application is that the user would need to submit a Sub Form before submitting the Main Form. And when they submitted the Sub Form, it will navigate back to Main Form(On Sucess, navigate, I know)
The catch is that, there will be a button or a box in Main Form that will indicate the user whether have they submit Sub Form or not.
Blue colour = Have not submit yet.
Green colour = submitted.
I tried putting
Navigate(MainForm,Fade) && Button6.Fill =RGBA(99, 139, 44, 1)
or
Navigate(MainForm,Fade); Button6.Fill =RGBA(99, 139, 44, 1)
both doesnt work. Any idea?
Solved! Go to Solution.
HI @insights360 ,
Based on the formula that you mentioned, I think there is something wrong with it. Currently, within PowerApps app, we could not assign a value to a property of a control directly within another control.
Based on the needs that you mentioned, I think a variable could achieve your needs. Set the OnSuccess property of the Sub Form to following:
Navigate(MainForm,Fade, {SubFormRecord: SubForm.LastSubmit})
Within your MainForm Screen, set the Fill property of the Button6 to following:
If(
!IsBlank(SubFormRecord),
RGBA(99, 139, 44, 1),
RGBA( 0, 0, 255, 1 )
)
In addition, you could also consider set up a global variable to store the submitted record from the Sub Form. Set the OnSuccess property of the Sub Form to following:
Set(SubFormRecord, SubForm.LastSubmit);
Navigate(MainForm,Fade)
Set the OnVisible of the Sub Form screen to following:
Set(SubFormRecord, Blank());
Within your MainForm Screen, set the Fill property of the Button6 to following:
If(
!IsBlank(SubFormRecord),
RGBA(99, 139, 44, 1),
RGBA( 0, 0, 255, 1 )
)
Please take a try with above solution, check if the issue is solved.
Best regards,
@insights360 not 100% sure if understand your case but from below information I would suggest you could take one of two approaches OnSuccess:
- use Set to create Global variable - that is recommended if you have more than one screen which is connect with fact that Sub Form was Submit (assume not in your case)
For you would suggest simply:
- OnSuccess of the SubForm apply:
Navigate(Screen1,ScreenTransition.Fade,{varSubmit:true})
- Then connect the button fill with the value of the varSubmit
Hope it make sense if not feel free to ask extract questions. If I answered your question please mark it as solution.
The colour changes to green after i submitted the sub form, but if i have a new form in the main form (have yet to submit sub form), the button is still green.
Ideally, I need it the indicator button (currently sit in MainForm) to reset it to blue whenever a user apply for a new formand only will change to green when a user submit a sub form.
Ok, so we have the part when it change to green.
How you are entering the Main New Form? If it is from additional screen / button you can use the same method only add the change to make the varSubmit false.
Hi,
I've done this by using the UpdateContext variable to set the color change of a button or icon. Combined with navigate, maybe you we achieve a satisfied result.
You can try to change color on the button/label by setting the OnSucess property of the submit sub form button to
Navigate(ExpenseHomeScreen,Fade, {Submitform:true})
And then on the MainForm set the Color/Fill-property of the button/label/icon to
If(Submitform,ColorValue("#04a9f4"),ColorValue("#f4d504"))
(Not the right color code for you).
And then revert the Updated context variable if needed.
First screen:
Screen navigated to, where the color of the icon is set to blue since til UpdateContext variable changed it.
Hope it can help you on your way.
Best,
Cathrine
HI @insights360 ,
Based on the formula that you mentioned, I think there is something wrong with it. Currently, within PowerApps app, we could not assign a value to a property of a control directly within another control.
Based on the needs that you mentioned, I think a variable could achieve your needs. Set the OnSuccess property of the Sub Form to following:
Navigate(MainForm,Fade, {SubFormRecord: SubForm.LastSubmit})
Within your MainForm Screen, set the Fill property of the Button6 to following:
If(
!IsBlank(SubFormRecord),
RGBA(99, 139, 44, 1),
RGBA( 0, 0, 255, 1 )
)
In addition, you could also consider set up a global variable to store the submitted record from the Sub Form. Set the OnSuccess property of the Sub Form to following:
Set(SubFormRecord, SubForm.LastSubmit);
Navigate(MainForm,Fade)
Set the OnVisible of the Sub Form screen to following:
Set(SubFormRecord, Blank());
Within your MainForm Screen, set the Fill property of the Button6 to following:
If(
!IsBlank(SubFormRecord),
RGBA(99, 139, 44, 1),
RGBA( 0, 0, 255, 1 )
)
Please take a try with above solution, check if the issue is solved.
Best regards,
User | Count |
---|---|
196 | |
125 | |
88 | |
49 | |
42 |
User | Count |
---|---|
285 | |
162 | |
138 | |
76 | |
73 |