Im stuck on a problem that is driving me nuts, below you will see an image of my test app,
This app currently uses the labels to make sure the user is using the correct text format which is in the range ZZ000001 - ZZ999999,
The text input is collected into the gallery and also uses the following onchange in the text input
If(Value(Right(SampleIDTEXTINPUT.Text,5))>000001&&Value(Right(SampleIDTEXTINPUT.Text,5))<999999&&IsMatch(Left(SampleIDTEXTINPUT.Text,2),"ZZ"),true,Notify("**Format of entered value should like ZZ000001**",NotificationType.Error);Reset(SampleIDTEXTINPUT))
when the app loads the intial text input needs to be blank and im currently im using the following in the default of the text input
I need the checkbox added to turn off the text formating so the user can enter empty sampleID's and i also need for the app to record the last (next) sample id number for when they turn the checkbox off it starts working as normal, so they can turn it off and on again as in the following example but instead of the 000001 it should be ZZ000005 the text input always reverts back to ZZ000001 using the above default code
Can you post the formula that you're using to determine the value in your NextSampleID textbox? That's probably where the problem lies.
Thats the next sampleID text
The First2Letters is Just a textinput with ZZ in it and the other one is below
Text(LastSubSampIDNumber.Text + 1, "[$-en]000000")
And that one in this is below
Which gets it from
Hence the loop to make the numbers accrue upwards. I just want it too show the next sample id it should be and on the first time be blank so they have to put the first sample id in
Ie in the example above it should be showing ZZ000005 however if i press the checkbox it shows ZZ000001 again..
I'm guessing this is reverting to 1 because the last item in your gallery has a empty sample ID value. I would try filtering out the blank values:
Last(Filter(Gallery1.AllItems, SampleID <> "").SampleID
Thanks for your message, and apologies about the typo - there was missing closing bracket.
Last(Filter(Gallery1.AllItems, SampleID <> "")).SampleID
I think the key to this is to make sure that you can retrieve the ZZ000004 value, and hopefully the formula above will do this. Once this part works, everything should flow smoothly from that point onwards.
Its doesnt, i would have replied earlier but the microsoft and html data stopping me from posting and banning me for 3600secs everytime for no reason really drives me nuts
The Code just turns off the automatic accuring of text and values (Next sample Ids) and when turning the checkbox off and on it just keeps putting the same value over and over again (see pic below)
Looking at you screenshot, it appears that you are determining the 'Next Sample ID' correctly - ZZ800802 in this example.
So presumably, I'm guessing that the fault lies in formula that's attached to 'Add button' button. Can you share the code that you have here? Are you calling Patch and referencing the correct sample ID?
But the code needs to collect from the text input, the others are just labels that seperate the text into Text and numbers and then concatenates (this code is the next sampleID in that label)
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.