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

Using If and IsBlank in a gallery label

Hello guys

 

I'm building a normal gallery for my app but there is a label that I need to show the text based on if a field have data or not.

For this I'm using this expresion:

 

If(IsBlank(ThisItem.'New_owner'),ThisItem.'System Owner',ThisItem.'New_owner')

What I'm trying to achieve is that if the New_owner field is blank them bring me the text in the System Owmner field, if not, take the text from New_owner.

 

However, powerapps does not allow me to do this because it says "invalid argument type (text). Expecting a record value instead).

 

thanks for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@dev85 

If System Owner is of type text, then change your formula to:

Coalesce(
    ThisItem.'New_owner'.DisplayName,
    ThisItem.'System Owner'
)
_____________________________________________________________________________________
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

4 REPLIES 4
PowerRanger
Super User
Super User

@dev85 Where does the Data come from? What field type is "New_owner" and "System Owner"? Is it a TextField or a person field? (Assuming you are using SharePoint)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.




​Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

If the content was useful in other ways, please consider giving it Thumbs Up.
RandyHayes
Super User
Super User

@dev85 

Assuming it is a person column you are working with...

Please consider changing your Formula to the following:

Coalesce(
    ThisItem.'New_owner'.DisplayName,
    ThisItem.'System Owner'.DisplayName
)

Your trouble is that you are trying to display a record in a text property...you need to specify the column you want.  In the above, DisplayName was chosen.

 

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!

You are correct, the info is coming from a sharepoint list. The new_owner field is a type person and the system_owner is a type text.

RandyHayes
Super User
Super User

@dev85 

If System Owner is of type text, then change your formula to:

Coalesce(
    ThisItem.'New_owner'.DisplayName,
    ThisItem.'System Owner'
)
_____________________________________________________________________________________
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 News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

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.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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