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.

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,325)