cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AGS94 Resolver I
Resolver I

Issues Setting Global Variable

 

I had posted this issue previously and thought it was solved, but I am still having problems.

 

I have the following formula in the OnSelect of the next arrow of a gallery (FavProd😞

Select(Parent)
;If(FavProd.Selected.ChkF=Lower("false"),Set(VarChkF,false),Set(VarChkF,true))
;Navigate(Mixing,ScreenTransition.Fade)

I have tried setting FavProd.Selected.ChkF equal to:

  1.  false 
  2. "false"
  3. Lower("false") (as shown above. This was out of desperation to find a solution)

To help troubleshoot, I have two text labels - one with FavProd.Selected.ChkF, (results in false, which is correct) the other with VarChkF (results in true no matter what I have tried). 

 

Side note: I have a total of three occurances of setting VarChkF in the app. In addition to the one above, the other two occurances set VarChkF to false via (Set(VarChkF, false)).

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Issues Setting Global Variable

@ASG94
I was finally able to test on a computer. You want to compare against the value “False”. First letter is uppercase and the rest are lowercase.

Select(Parent)
;If(FavProd.Selected.ChkF=“False",Set(VarChkF,false),Set(VarChkF,true))
;Navigate(Mixing,ScreenTransition.Fade)


Please Accept as Solution if this post answered your question so others can find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

9 REPLIES 9
Super User
Super User

Re: Issues Setting Global Variable

@AGS94 

What does the table in your datasource look like?  Could you please share a screenshot?

AGS94 Resolver I
Resolver I

Re: Issues Setting Global Variable

 

Here your go. Note that all formulas referecning the various column values are working as expected in the gallery's NextArrow1.OnSelect except the Chk"x"s (B thru F). 

 

PA20191004.png

Super User
Super User

Re: Issues Setting Global Variable

deleted post
AGS94 Resolver I
Resolver I

Re: Issues Setting Global Variable

 

Actually I only have one favorite saved thus far (shown in row 8 of the Excel worksheet pic) - the blank rows are not part of the actual Excel table that my app is referencing. So far the only rows in the table are rows 7 and 8 and those are the only rows the app is actually referencing.  As I save a favorite, a new row will be added to the Excel table and the app will then be able to reference that new row as well.

 

The way I have it set up is when a new favorite is saved, ChkB through ChkF will always either be true or false. I have verified via a text label that FavProd.Selected.ChkF does indeed return false as is shown in Cell V8. Also verified, for example, that FavProd.Selected.ChkD returns true as shown in Cell T8.

 

That said, if I do as you suggest, wouldn't the result always be true? My apologies if I am missing anything.

Super User
Super User

Re: Issues Setting Global Variable

@AGS94
I deleted my latest post right before you posted back. I was looking at the column called ItmF instead of ChkF. That’s why my response did not make any sense.

Please do two more things for me.
1. Click on cell V8. Take a screenshot. Let me see what is in the Excel formula bar.
2. Try the formula =TYPE(V8) on a blank cell in your spreadsheet. This will return a number that tells us the data type. Let me know the result.
Super User
Super User

Re: Issues Setting Global Variable

@ASG94
You might also want to try replacing lower(“false”) with upper(“false”)
AGS94 Resolver I
Resolver I

Re: Issues Setting Global Variable

 

Screenshots below. No formula in V8, just text (as shown). I clicked on the cell to get the Type and also keyed in TYPE(V8). Both returned "4" (shown in Cell C2)

 

I also tried "Upper" and still the same results.

 

This seams to be a simple formula. No idea why the trouble.  Thanks for sticking with me on this one.

 

SHot2.pngshot1.png

Super User
Super User

Re: Issues Setting Global Variable

@ASG94
I was finally able to test on a computer. You want to compare against the value “False”. First letter is uppercase and the rest are lowercase.

Select(Parent)
;If(FavProd.Selected.ChkF=“False",Set(VarChkF,false),Set(VarChkF,true))
;Navigate(Mixing,ScreenTransition.Fade)


Please Accept as Solution if this post answered your question so others can find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

AGS94 Resolver I
Resolver I

Re: Issues Setting Global Variable

 

It worked! I owe you a virtual beer. Thanks for all the help!

 

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,310)