cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
blanghorst
Helper IV
Helper IV

SharePointIntegration - load different screens based on column value

I'm trying to modify the SharePointIntegration OnEdit, OnView, etc. events so that upon form open, the proper screen is opened.  I'm having a little trouble and am sure it is something simple.  I read the following excellent post:

 

https://powerusers.microsoft.com/t5/General-Discussion/Load-powerapps-screen-based-on-sharepoint-ite...

 

In my case, the CA Status column is a choice column with various text values, such as New, Pending, etc.  What I want to do is when the form launches, I want to review the CA Status value of the list item and navigate to the proper screen.  I can't quite get the format right.   The following gives me "Incompatible types - the left value is a number and the right is text.  I do understand why I am getting the error but am not sure what to do, because if I remove the VALUE function, I also get an error.  How can I modify the functions below to fix the issue?

 

Set(varStatus,Value(SharePointIntegration.Selected.'CA Status'));
If(varStatus="Pending"),Navigate(Pending,ScreenTransition.None));
EditForm(SharePointForm)

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for your help - I got it working with the following code:

 

Set(varCAStatus,SharePointIntegration.Selected.'CA Status'.Value);
If(varCAStatus="Pending",Navigate(Pending,ScreenTransition.None));
EditForm(SharePointForm)

 

I thought for sure I tried appending .Value at the end and it didn't work before.

View solution in original post

2 REPLIES 2
TimRohr
Solution Sage
Solution Sage

So, Value() is going to return a number. When you assign that to your variable and later try to test that variable against text ("Pending"), you run into the error you describe. You definitely want to get rid of the Value() piece.

 

Then, see if you can represent the data that you are trying to write from your 'CA Status' column. Assign it to a context variable and set a label to have that variable as the text. Or use:

Notify(SharePointIntegration.Selected.'CA Status')

...in an event to see what that says. Put a period after it and see if it needs another bit to hone in on the data that you are really after (the text). If none of that works, post back with the error you get when  you remove the Value() function.

 

Thanks for your help - I got it working with the following code:

 

Set(varCAStatus,SharePointIntegration.Selected.'CA Status'.Value);
If(varCAStatus="Pending",Navigate(Pending,ScreenTransition.None));
EditForm(SharePointForm)

 

I thought for sure I tried appending .Value at the end and it didn't work before.

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.

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,503)