cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pbrierley1
New Member

(If function) or (If function) returning false

Hello,

 

I have a datacard in a form on my app, whereby I'd like different values to be returned dependent on the button selected. The two buttons are nested within the datacard as below:

 

pbrierley1_0-1658389296204.png

 

The first button is a readNFC() which subsequently defines a global variable. This works fine, and I've been using the app successfully with just the singular button. The second which I've just added is a standard button which defines a second global variable when clicked.

 

For context, the datacard is a required field which feeds an excel document. I would like defined answers to ensure that formulas in excel run correctly. At present, users are manually inputting text which is throwing off formulas. When I get this right, I will eventually turn off manual input on the datacard.

 

I have the below defined for the datacard, however, it is returning false:

 

Datacard: (section in red has worked thus far no problem.)

If(Value(Var401.Text)=401, (Text(Now(), "dd/mm/yyy hh:mm")), "Incorrect Tag") Or If(Var401000=9999, "Error", IsEmpty(Var401000), "")

 

Button 1:

Set(Var401, ReadNFC())

 

Button 2:

Set(Var401000, 9999)

 

Any hints would be greatly appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WiZey
Super User
Super User

Hello @pbrierley1 ,

 

I think it's a typo. Can you try with the formulae below?

 

If(Value(Var401.Text)=401, 
   (Text(Now(), "dd/mm/yyy hh:mm")), 
   Var401000=9999, 
   "Error", 
   IsEmpty(Var401000), 
   "",
   "Incorrect Tag")

View solution in original post

2 REPLIES 2
WiZey
Super User
Super User

Hello @pbrierley1 ,

 

I think it's a typo. Can you try with the formulae below?

 

If(Value(Var401.Text)=401, 
   (Text(Now(), "dd/mm/yyy hh:mm")), 
   Var401000=9999, 
   "Error", 
   IsEmpty(Var401000), 
   "",
   "Incorrect Tag")
pbrierley1
New Member

@WiZey Thanks, this has worked wonders - and much more succinct code.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,074)