cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
habram
Helper I
Helper I

text of datacardvalue is always blank

Hi everyone, 

am trying to build an online inventory to request supplies for the printers. So, am using a form to show the database and i added an if function to filter the items a user can choose based on the printer model chosen.

 

habram_0-1640007944036.png

So when the user, for example, choose HP Laserjet M201 in the printer model, only black toner will show in the item type. So far, all is good. However, another if is set on the default of the datacardvalue of the Product Number that will check both Printer Model and Item Type selected value and will return a text automatically.

 

If i submit the form, the text value is recorded in the SharePoint list. But, if I try to compare this value to anything or using it in any function, it is always returning blank.  For example, if i put a label and put the following in the text: if(datacardvalue.text="83A","Yes","No") it is returning No. It is not able to read the value returned by the IF function.

 

What should i do? because i need to update the inventory (database) based on this unique value at later stage.

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@habram 

Yes, I just set it to a valid record.  In my case I used:

   LookUp(myDataSource, ID=1)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

23 REPLIES 23
RandyHayes
Super User
Super User

@habram 

I would first determine if you are missing some blanks that you do not see (trailing blank).

So, If(Trim(DataCardValue.Text)="83A","Yes","No")

Beyond that, I would always rely on the underlying source in the case of a read only column (looks like that is read only).  If it is part of the record, then use the column value of the record instead.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
habram
Helper I
Helper I

@RandyHayes Whenever i use DataCardValue.Text in any formula, it is always returning a blank value; that's why the If function is not working. For example, i set the default of a text input to datacardvalue.text and it is returning blank while it displays a text inside.

 

habram_0-1640243473380.png

 

RandyHayes
Super User
Super User

@habram 

Okay, thanks for clarifying.

So, that should not be the case that you are seeing...let's troubleshoot a little.

First, put a label inside the datacard where DataCardValue18 is and set the Text property to: DataCardValue18.Text See what that shows.

Then put a label outside of the form and set the Text property to be the same as above.  What does it show?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes 

Allow me to thank you first for your support,

 

When i added the label inside the datacard, it works 

But, if i add it outside the form, it returns blank.

 

Thanks,

RandyHayes
Super User
Super User

@habram 

No problem - happy to help!

 

So I've heard of this scenario from some in the past couple weeks.  It is very unusual and I've never run into it first hand - and I do a lot of reference in and out of forms in many apps.

 

So, let's see if we can figure out a common problem.  

First a couple of general questions:

This is a regular Canvas App - correct?

You have the Form directly on the screen, no container involved - correct?

 

If you could click on the control in your form datacard and have it expanded in the tree control on the left and then send a screenshot of that, it would be great!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

Yes it is a regular canvas app without any container

 

here is a screenshot:

 

habram_0-1640284220202.png

 

RandyHayes
Super User
Super User

@habram 

I am seeing something unusual!

In the picture, your datacards are not aligned with each other:

RandyHayes_0-1640286634054.png

That is not normal.  Is that really how it appears in your tree?  If so, then something is wrong with that form.  Perhaps that is causing the problem?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
habram
Helper I
Helper I

@RandyHayes ah no, my bad, i took 2 screenshots and combined them because am working now on the laptop screen; a 14 inch one.

 

Usually, if a label is outside the form, it should work normally when referring to a datacard from the form by only typing datacardvalue.text?

RandyHayes
Super User
Super User

@habram 

Yes, that is normal.  What you are seeing is not normal.

For example, below, the yellow is a label outside of a form and the green is the text input inside the form.

RandyHayes_0-1640287835529.png

The label is set to, in this case, DataCardValue45.Text

 

SO...let's try one other troubleshooting step:

1) Put a new TextInput control inside of your datacard and set the Default property to: "Testing"

2) Place a label outside of the form and set its Text property to: thatTextInputAddedName.Text

 

See if that shows "Testing" in the label.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,721)