cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StraighterSwing
Frequent Visitor

Setting variable value as text and setting visibility based on variable

I'm a newbie to Powerapps but I've searched both this forum and the internet but cannot figure out my problem.  I'm hoping it's something really simple.

The form is created from a SharePoint list:

1. In the OnVisible property, I wanted to set the text and show a field if the value of a varible is something.

     a. In the OnVisible of the screen, I set a variable: Set(varStatus,'Annual Evaluation-Salaried'.Status)

     b. The Text property of the textbox is set to varStatus (This doesn't work)

     c. The Visible property of the textobx is set to varStatus="Draft-User"; (This doesn't work)

     

What am I doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

Did you use the PowerApps customize forms button in SharePoint to create the form, so you have a control called SharePointIntergration?

If so try this in the OnVisible:  Set(varStatus,SharePointIntegration.Selected.Status)

*This assumes that Status is a text column in SharePoint

 

FYI: If you make this change in the studio and want to test it right away then you need to navigate to another screen and back for the OnVisible event to trigger.

 

I assume 'Annual Evaluation-Salaried' is the name of the list and if so 'Annual Evaluation-Salaried'.Status will return a one column table representing the status of each record. If this is the cause the text should have given an error about an unexpected data type expecting text.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Jeff_Thorpe
Super User
Super User

Did you use the PowerApps customize forms button in SharePoint to create the form, so you have a control called SharePointIntergration?

If so try this in the OnVisible:  Set(varStatus,SharePointIntegration.Selected.Status)

*This assumes that Status is a text column in SharePoint

 

FYI: If you make this change in the studio and want to test it right away then you need to navigate to another screen and back for the OnVisible event to trigger.

 

I assume 'Annual Evaluation-Salaried' is the name of the list and if so 'Annual Evaluation-Salaried'.Status will return a one column table representing the status of each record. If this is the cause the text should have given an error about an unexpected data type expecting text.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Thanks Jim, this helped a lot!  I've been trying to figure out PowerApps and all the different areas and nuiances which is proving to be difficult.  When to use the onVisible in the App, Form, now the SharePoint Integration.  It's daunting.

I'm trying to find the 'mark as answer' and as soon as I do, I'll mark your response. 🙂

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (42,413)