Hi,
I have a canvas app with a gallery, when i press the add button items are collected in a collection.
In one of my text inputs i put into the gallery i have a few pieces of code that makes sure the user is sending the correct text format and then it continues the entries by adding +1 to the number for example
| SampleID | Yes/No Column | Other |
| ZZ10000 | Yes | Random |
| ZZ10001 | No | Other Random |
| ZZ10002 | No | More Random examples |
So ive been asked to add a checkbox that can disable the autoadding of the numbers and text in the sample ID (sometimes they are not sampling) and then when they press off the checkbox the numbers start adding again from where they left off (in this example the next row would be ZZ10003
So my code is for the checkbox OnCheck: Set(varLASTGalNo,NextSampleID.Text)
NextSampleID.Text is the next text and number that is in the sequence ie ZZ10003
my default code on the Textinput that is patched to sharepoint is
If(IsEmpty(GeologyGallery.AllItems) && Checkbox1.Value=false,"", Checkbox1.Value=false,varLASTGalNo, NextSampleID.Text)
The first part of the multiple if statement checks if the gallery is new and the checkbox is unchecked (the text input at the beginning needs to be empty so a notify error reminds the user to put in the correct format ZZ000001 - ZZ999999 and nothing else)
the variable varLASTGalNo is the variable from above.
However the code to make the autonumbering doesnt work>? is there a way to make the Checkbox1.Value=false,varLASTGalNo in the code below and above only run once? and then put in the NextSampleID.Text text and number?
If(IsEmpty(GeologyGallery.AllItems) && Checkbox1.Value=false,"", Checkbox1.Value=false,varLASTGalNo, NextSampleID.Text)

Report
All responses (
Answers (