cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
insights360
Helper I
Helper I

How to indicate that the Form has been submitted?

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?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

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,

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

View solution in original post

7 REPLIES 7
PowerAddict
Super User II
Super User II

Set a variable to true on the OnSuccess of the form: Set(varColor, true)

Then set the Fill property of Button6 to:
If(varColor, Green, Blue)

Set thevaroabke to false on the OnVisible property of the screen where the sub form is.

You cannot directly reference control properties to assign values to them. Instead, you can use variables.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
365CornerDawid
Resolver III
Resolver III

@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.

The button that you use to set the Main form as a new form, set the variable to false.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

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.

CathrineB
Frequent Visitor

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:

Merknad 2020-02-20 100246.png

 

Screen navigated to, where the color of the icon is set to blue since til UpdateContext variable changed it. 

Merknad 2020-02-20 100353.png

 

Hope it can help you on your way.

 

Best,

 

Cathrine

 
v-xida-msft
Community Support
Community Support

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,

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

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (58,434)