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.

View solution in original post

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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

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