I have a unique ID which is in a read-only text box input. I wish to have this number increment by one each time the proceed button is pressed. So far, I have only been able to use solutions that must connect to my SharePoint database. I wish to have this number independent and simply increment by one, then write this new number to a SharePoint list.
Here's my current attempt:
varIncrement + 1
varIncrement is inside the text input Default property.
Any help would be appreciated.
You are close, but you have to seperate the Set from the increment.
1) Add the Set(varIncrement,1) to the OnStart method of the App
2) Add Set(varIncrement, varIncrement + 1) to the BtnProceed OnSelect event
3) Set the Default property of the Textbox to varIncrement
Thank you for the response, very helpful!
With your solution, the number still does not increment by one every time the Proceed button is pressed. Have you any idea as to why? I am currently trying to figure it out.
Thanks for the help.
Not sure what is happening in your version. I built it in my environment just as described and it worked fine. Do you have other commands being issued by the Proceed button?
Yes, it is within a large if statement that error handles an entire submit form. See below the if statement in question. I may have the order wrong in places, but the logic behind the statement looks fine.
Start_3.SelectedDate > Now(),
Notify("Start date can not be later than today."),
End_3.SelectedDate > Now(),
Notify("End date can not be later than today."),
Start_3.SelectedDate > End_3.SelectedDate,
Notify("Start date must be before end date."),
Notify("Please enter an affected system."),
Notify("Please enter a comment."),
Value(txtUpdatedTotalHours_2.Text) > difference,
Notify("Total hours can not exceed the total hours between the selected dates. Please choose a correct total hours option."),
varIncrement + 1
It looks to me like your parentheses are off in your IF statement. The way I read it in an editor the set will only fire if
Value(txtUpdatedTotalHours_2.Text) <= difference. I also think a lot of your comma's in that If statement should be semicolons. It would read more cleanly if you seperated out the individual IF statements and used them to set a variable, then acted on the value of that variable to do your set and submit at the end.
Thank you for the help! I have manipulated the if statement and reorganized certain conditions. The record number now increments correctly. I have just discovered a new issue with this unique ID. In the OnStart section of the app, the variable varIncrement must increment from the previous record number stored in the Database. So rather than Set(varIncrement, 1) it must be Set(varIncrement, [last record number stored]).
I will look into this, but thank you for your help!
All the best.
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
The largest Power BI, Power Platform, and Data conference in New Zealand