cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Two text fields, both Blank(), not equal?

Having trouble with this one. 

Scenario:

  • Textbox that is blank
  • Gallery Selected record with a text field that is blank
  • When compared, they are not equal!?
txtTest1.Text = glrItems.Selected.Test1 // FALSE

txtTest1.Text <> glrItems.Selected.Test1 // TRUE IsBlank(txtTest1.Text) // TRUE IsBlank(glrItems.Selected.Test1) // TRUE And(IsBlank(txtTest1.Text), IsBlank(glrItems.Selected.Test1 )) //TRUE

Ideas?

7 REPLIES 7
Highlighted
Dual Super User II
Dual Super User II

Re: Two text fields, both Blank(), not equal?

Hi @ericonline 

 

If Test1 is a text field in the gallery then

txtTest1.Text = glrItems.Selected.Test1.Text 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Highlighted
Super User
Super User

Re: Two text fields, both Blank(), not equal?

Hi @RezaDorrani ,

No dice. Won't take another .dot.

image.png

Highlighted
Dual Super User II
Dual Super User II

Re: Two text fields, both Blank(), not equal?

Hi @ericonline 

 

what type of column is it in the gallery?

label or textbox

Highlighted
Super User
Super User

Re: Two text fields, both Blank(), not equal?

Gallery.Selected.xyz allows you to select any field in the record. The field does not need to be in the actual gallery. I'm successfully using Gallery.Selected.FieldName in ALL other comparisons in the code. 
Its just this one causing the problem. And both sides are Blank() ! which is bizarre

image.png

Highlighted
Community Support
Community Support

Re: Two text fields, both Blank(), not equal?

Hi @ericonline ,

Do you set a Default "" value for the Test1 field in your data source?

Do you have set the Default property of the txtTest1 box to ""?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:12.JPG

 

If you set the Default property of theTextInput box to "", the above formula Gallery1.Selected.Gender=TextInput1.Text would return false. Please check the following GIF screenshot for more details:Test.gif

 

 

Please check if you have set a Default value ("") for the Test1 field in your data source or the txtTest1 box.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Super User
Super User

Re: Two text fields, both Blank(), not equal?

Wow this one has been a wild goose chase!

Check out these findings:

  • Screen1:
    • Gallery (glrGallery)
    • User selects an item and is navigated to Screen2
  • Screen2:
    • Form (frmForm)
      • Item property set to 
        If(
            frmForm.Mode = FormMode.Edit,
            glrGallery.Selected
        )
      • (I love using this pattern by the way! It allows me to use a single form for creating, viewing and editing data)
    • Button (btnEdit)
      • Changes each control DisplayMode to edit
    • Button (btnSubmit)
      • DisplayMode property set to
      • If(
           And(
                txtFormItem1.Text = glrGallery.Selected.Item1,
                ddFormItem2.Selected.Value = glrGallery.Selected.Item2,
                cmbFormItem3.Selected.DisplayName = glrGallery.Selected.Item3.DisplayName
            ),
            DisplayMode.Disabled,
            DisplayMode.Edit
        )
      • (This pattern is used to ONLY allow the Submit button to be selectable IF an original value has changed)
  • THE ISSUE:
    • IF any of the glrGallery.Selected values are blank, they do NOT carry over to the form's Item property!
    • They cannot be used to compare against.

Does anyone have a better pattern for comparing an original record state to an altered state (using a Form?)

Highlighted
Anonymous
Not applicable

Re: Two text fields, both Blank(), not equal?

Bumping to see if the community can assist 

 

@Anonymous 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,974)