web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Multiple If Statments ...
Power Apps
Unanswered

Multiple If Statments with CheckBox and repeating numbers and values

(0) ShareShare
ReportReport
Posted on by 301

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

 

SampleIDYes/No ColumnOther
ZZ10000YesRandom
ZZ10001NoOther Random
ZZ10002NoMore 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)

 

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard