Im trying to get the useValue datacard in a form and use it as a variable within the code below,
HOWEVER the variable use gives me an error.
Can someone help me.
I want to use the useValue that the user inputs and if useValue is bigger than totalSum then Displaymode disabled.
With(
{Tot:Sum(BoughtTotal-UsedTotal),use:useValue},
If(
Tot > 0,
use <= Tot,
SubmitForm(UseRegisterForm),
Navigate(RecordPage),
use > Tot,
DisplayMode.Disabled
)
)
Please help me
Solved! Go to Solution.
Hi @tsangd ,
Could you please share more details about your scenario? Is there any screenshot of the Edit form could further explain your goal? Could you explain your logic again? Which control you are wanting to disable when useValue is bigger than totalSum, the submit button?
Your formula looks very incorrect that the use of If statement have several mistakes.
If function:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if#syntax
If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )
If you would like to disable the submit button when useValue is bigger than totalSum, you should set formulas on the DisplayMode of the button rather than combining to OnSelect. So, I guess, OnSelect of the button:
With(
{Tot:Sum(BoughtTotal-UsedTotal),use:useValue},
If(
Tot > 0,
SubmitForm(UseRegisterForm),
Navigate(RecordPage)
)
)
DisplayMode of the button:
With(
{Tot:Sum(BoughtTotal-UsedTotal),use:useValue},
If(
use > Tot,
DisplayMode.Disabled,
DisplayMode.Edit,
)
)
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Hi @tsangd ,
Could you please share more details about your scenario? Is there any screenshot of the Edit form could further explain your goal? Could you explain your logic again? Which control you are wanting to disable when useValue is bigger than totalSum, the submit button?
Your formula looks very incorrect that the use of If statement have several mistakes.
If function:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-if#syntax
If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )
If you would like to disable the submit button when useValue is bigger than totalSum, you should set formulas on the DisplayMode of the button rather than combining to OnSelect. So, I guess, OnSelect of the button:
With(
{Tot:Sum(BoughtTotal-UsedTotal),use:useValue},
If(
Tot > 0,
SubmitForm(UseRegisterForm),
Navigate(RecordPage)
)
)
DisplayMode of the button:
With(
{Tot:Sum(BoughtTotal-UsedTotal),use:useValue},
If(
use > Tot,
DisplayMode.Disabled,
DisplayMode.Edit,
)
)
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.