cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jdelacrettaz
Level: Powered On

While, loop or cycle. Convert code c# to work in my app

I need to translate this code that I have created in C # so that it can work in my powerapps application. What it does is a while increasing 0.01 to the amount entered
Code:
Float pr = quantity;
Decimal See = decimal.Parse (quantity.ToString ());
If (pr % float.Parse (lblCoefArt.Text)! = 0)
         {
             While (enter == true)
             {
                 See = See + 0.01m;
                 If (See% decimal.Parse (lblCoefArt.Text) == 0)
                 {
                     String fun = "MUST BE:" + See
                 }
             }
         }

LblCoefArt.Text = Coefficient of my database
Quantity = Quantity entered by the user

Fun = Shows the quantity that the user has to enter

4 REPLIES 4
Community Support Team
Community Support Team

Re: While, loop or cycle. Convert code c# to work in my app

Hi @jdelacrettaz,

 

I'm investigating on this question and will update you once I got any update later.

 

Regards,

Mona

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jdelacrettaz
Level: Powered On

Re: While, loop or cycle. Convert code c# to work in my app

I hope you find a solution. Thank you so much for help me
Community Support Team
Community Support Team

Re: While, loop or cycle. Convert code c# to work in my app

Hi @jdelacrettaz,

 

Currently there is no loop function (like the While, or do until) available in PowerApps.

If you would like PowerApps to add this function, then please consider submit this as an idea in the following forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

There is if function available under PowerApps, but the logic is the following:

If( Condition, Result [, ElseResult ] )
If( Condition1, Result1 [, Condition2, Result2, ... [ , ElseResult ] ] )

Once the condition is met, it will then show the result, which as a result, only calculate once.

 

For example:

If(Test1=0,UpdateContext({Test1:Value(TextInput1.Text)}),UpdateContext({Test1:Test1+1}))

Using the above formula in a button, would only make Variable Test1 + 1 for each time the button is pressed.

 

Adding the formula reference:

Formula reference for PowerApps

Understand variables in PowerApps

 

Edited,

There is a forall function, which would work for each row of the table, check to see if that would help in your scenario:
https://powerapps.microsoft.com/en-us/tutorials/function-forall/

If you have any further questions, please let me know.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
mr-dang
Level 10

Re: While, loop or cycle. Convert code c# to work in my app

The Timer control can loop operations. 

 

Change the Duration for how often you want the action to occur in milleseconds. 

Change the Start and Repeat properties to a condition for when you want the loop active.

Change the OnTimerEnd property to perform the action you want.

 

Microsoft Employee
@8bitclassroom

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 366 members 4,418 guests
Please welcome our newest community members: