cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JamesM
Level 8

Set value to true if text in InputTextBox found within Gallery Items?

I've tried the below, but false never changes to true Smiley Sad 

 

What I really want to do is disable the 'Save' button if the user has typed in a group name that exists already in the gallery. 

 

2018-12-07 11_05_59-Window.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Set value to true if text in InputTextBox found within Gallery Items?

hi @JamesM,

Do you want to make the ‘save button invisible when a value user typed in textInput control has been existed in the gallery

Could you please share a bit more about the “TitleGroupName” within your formula? Is it a Label control in your Gallery?

 

Based on the formula you provided, I think there may have something wrong with your formula.

 

I made a test on my side.  It worked.

16.PNG

Set the visible property of ‘save button to: isfound

Set the onchange property of textinput1 to :

If(TextInput1.Text in Gallery1.AllItems.Title,UpdateContext({isfound:false}),UpdateContext({isfound:true}))

 

regards,

eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Highlighted
samuelJ
Level 8

Re: Set value to true if text in InputTextBox found within Gallery Items?

Hi,

 

You should try to code something like the below, that will check if a record exists:

 

if (Count(LookUp(TablePopulatingGallery, TablePopulatingGallery.SomeField = TextInputGroupName.Text)) > 0, //true Code, //false Code)

 

You should check the table/collection populating the gallery.  Also i don't see anywhere where the variable is set to false, only true.  Is there a reason you do not set the varaible to false? Is it set to false somewhere else? 

Community Support Team
Community Support Team

Re: Set value to true if text in InputTextBox found within Gallery Items?

hi @JamesM,

Do you want to make the ‘save button invisible when a value user typed in textInput control has been existed in the gallery

Could you please share a bit more about the “TitleGroupName” within your formula? Is it a Label control in your Gallery?

 

Based on the formula you provided, I think there may have something wrong with your formula.

 

I made a test on my side.  It worked.

16.PNG

Set the visible property of ‘save button to: isfound

Set the onchange property of textinput1 to :

If(TextInput1.Text in Gallery1.AllItems.Title,UpdateContext({isfound:false}),UpdateContext({isfound:true}))

 

regards,

eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.