cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Dual Super User
Dual Super User

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

 

Super User
Super User

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

Hi @RezaDorrani ,

No dice. Won't take another .dot.

image.png

Dual Super User
Dual Super User

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

Hi @ericonline 

 

what type of column is it in the gallery?

label or textbox

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

Community Support Team
Community Support Team

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.
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?)

Administrator
Administrator

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

Bumping to see if the community can assist 

 

@TopShelf-MSFT 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 156 members 5,393 guests
Please welcome our newest community members: