cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cmanning
Super User
Super User

Canvas App - Converting a Working App From SP Lists to a Dataverse Data Source Choice Column Types

I have a canvas app that has been working w/o issue for over a year using SP lists as the data sources.  Now I am converting the app to use a Dataverse data source and there are some errors I need.  The screen shown below, has a gallery on the left (see ThisItem errors) and an HMTL text field on the right (see HTML Text errors).
Deal Intake App Assignb Screen.png
The code below is for the gallery's Fill property. 
DV errors ThisItem for Choice cols.png

 

 

// SP List code with choice column errors
If( ThisItem.'Request-Status'.Value = "New", RGBA(255, 0, 0, 1), ThisItem.'Request-Status'.Value = "Scheduled", RGBA(54, 176, 75, 1), ThisItem.'Request-Status'.Value = "Completed Offline", RGBA(52, 178, 187, 1), ThisItem.'Request-Status'.Value = "Completed Live Meeting", RGBA(0, 0, 204, 1), ThisItem.'Request-Status'.Value = "On Hold", RGBA(255, 145, 0, 1) )

 

 

The code below is for HTML text in the right-hand side "Deal Information" section.
DV errors SELECTED for Choice cols.png

 

 

 "<ul>
    <li><b>Deal Request ID: </b>" & " " & galleryLHAssignResources.Selected.Name & "</li>
    <li><b>Request Status: </b>" & " " & galleryLHAssignResources.Selected.'Request-Status'.Value & "</li>
    <li><b>SFDC Opp Acct Name: </b>" & " " & galleryLHAssignResources.Selected.'SFDC-Opp-Acct-Name' & "</li>
    <li><b>SFDC OP ID: </b>" & " " & galleryLHAssignResources.Selected.'SFDC-Opp-ID' & "</li>
    <li><b>Deal Term: </b>" & " " & galleryLHAssignResources.Selected.DealTerm & "</li>
    <li><b>Client Due Date: </b>" & " " & galleryLHAssignResources.Selected.'Client-Due-Date' & "</li>
    <li><b>Close Date: </b>" & " " & galleryLHAssignResources.Selected.'Close-Date' & "</li>
    <li><b>TCV: </b>" & " $" & galleryLHAssignResources.Selected.TCV & "</li>
    <li><b>Pricing-Required: </b>" & If( galleryLHAssignResources.Selected.'Pricing-Required' = true, "Yes", "No" ) & "</li>
    <li><b>Sector: </b>" & " " & galleryLHAssignResources.Selected.Sector.Value & "</li>
    <li><b>Sales Stage: </b>" & " " & galleryLHAssignResources.Selected.'Sales-Stage'.Value & "</li>
    <li><b>RFx Sole Source: </b>" & " " & galleryLHAssignResources.Selected.'RFx-Sole-Source'.Value & "</li>
    <li><b>Submission Format: </b>" & " " & galleryLHAssignResources.Selected.'Submission-Format'.Value & "</li>
    <li><b>DHC Closer Score: </b>" & " " & galleryLHAssignResources.Selected.'DHC-Closer-Score'.Value & "</li>
    <li><b>DHC Predictor Score: </b>" & " " & galleryLHAssignResources.Selected.'DHC-Predictor-Score'.Value & "</li>
    <li><b>Presenters: </b>" & " " & galleryLHAssignResources.Selected.'Presenter(s)' & "</li>
    <li><b>Other Invitees: </b>" & " " & galleryLHAssignResources.Selected.'Other-Invitees' & "</li>
    <li><b>Requested By: </b>" & " " & galleryLHAssignResources.Selected.'Created By'.Email & "</li>
    <li><b>Offerings: </b>" & " " & Concat( galleryLHAssignResources.Selected.Offerings.Value, Value, ", ") & "</li>
    <li><b>Requestor Comments: </b>" & " " & galleryLHAssignResources.Selected.'Requestor-Comments' & "</li>
    <li><b>Reviewer Comments: </b>" & " " & galleryLHAssignResources.Selected.'Reviewer-Comments' & "</li>
</ul>"

 

Here are the Dataverse column names for ref.
DealIntakeApp Table
DIApp - DealIntakeApp table col names.png
AssignedUsers Table
DIApp - AssignedUsers table col names.png

 Any recommendations are greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Please, don't just randomly put quotes around things, that is not helping us and it is not solving the error in the way you think it is. As I explained before, if both sides are quotes then there is no datasource-based comparison going on, you are just comparing whether the string "cr4e_RequestStatus" is equal to the string "New". You could put "fartingUnicorns" = "HopesAndDreams" as that equates to the same formula you have when you put quotes on both sides.

 

I've tried to recreate your table as closely as I can and the only thing I think that could be different is that in your case we are likely referencing a custom choice that you have set up called cr4de_requeststatus(all lowercase). Please try using lowercase as per this formula:

 

If(
   "New" in ThisItem.cr4de_requeststatus,
   RGBA(255,0,0,1),
   RGBA(0,0,0,1)
)

 

 

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

18 REPLIES 18
iAm_ManCat
Super User
Super User

Hi @cmanning,

 

Try referring to the schema names rather than the display names (next column over in your table view) so like publishernamehere_RequestStatus then hit the . (period) after to see what intellisense brings up for the list of sub-properties that you can reference:

 

ThisItem.publishernamehere_RequestStatus.

 

Could you give that a try and let me know how you get on?

 

Thanks,

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


@iAm_ManCat - I really appreciate your response.  Can you pls clarify what you mean by "publishernamehere_"?

Of course, happy to help!

 

When you view the table in Dataverse, you have a second column called Name which is actually the schema name, and the columns may have been published by different publishers in each case so using this unique name is the best way to reference them in my opinion. The publisher in the below example is otsf.

 

If you just use the exact whole name listed there instead of the display name (displaynames need the ' ' around them) then it should be able to find it from within the App

 

image.png

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


@iAm_ManCat - Thanks for the update.  I know the publisher name you are referring to now, thank you.  Unfortunately, the popup menu only shows the options below so I can't target the DealIntakeApp.RequestStatus.  Any recommendations? Pls advise.
DV errors ThisItem for Choice cols II.png

Yeah the intellisense is not great, that's why I recommend looking at the table view from Solutions and copy-pasting the schema name after ThisItem.

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


@iAm_ManCat - Ok, so I did try ThisItem.PublisherName_dealintakeapp_RequestStatus followed by "." and then I typed "New" one of the choice values and it still threw an error. For simplicity sake, I limited it to a simply formula for test purposes.  
DV errors ThisItem for Choice cols III.png
And I also tried with single quotes as shown below.
DV errors ThisItem for Choice cols IIIb.png

Ok so had a play around with choice columns and its a bit more fiddly for choice and maybe I'm not doing it the most efficient way, but I got it working with:

Table: Answers

Primary Column: Answer (ie the GUID)

 

If(
   LookUp(Answers, meow_name = "No").Answer in ThisItem.Answers.Answer,
   RGBA(255,0,0,1),
   RGBA(0,0,0,1)
)

 

And then changed some of my Answers to prove it worked:

image.png

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


@iAm_ManCat - Thanks for updated info and it feels like we are very close!  Below is the screenshot from the Fill property.   The only only error now is in the ThisItem formula.  Pls note I was not able to reference the publisher name in ThisItem and typing the "." only brought up options (e.g., Duplicate stuff) that could not be used to resolve the error. 
DV errors ThisItem for Choice cols IV.png

 

// Only error is in:  ThisItem.RequestStatus
// Cannot use the publisher name in ThisItem
If(
   LookUp( DealIntakeApps, "publishername_dealintakepp_RequestStatus" = "New" ).RequestStatus in ThisItem.RequestStatus,
   RGBA(255,0,0,1),
   RGBA(0,0,0,1)
)

 

 Do you know how I might resolve the remaining error?  

we need to refer to the GUID value, so we should be referencing:

 

ThisItem.publishername_dealintakepp_RequestStatus.RequestStatus

 

 

Could you try that and let me know if that picks it up correctly? Also, you shouldn't need the quotes around publishername_dealintakepp_RequestStatus as its now just comparing two strings - was it not finding it when you didn't have quotes?

 

If(
   LookUp( DealIntakeApps, cr4de_dealintakeapp_RequestStatus = "New" ).RequestStatus
   in 
   ThisItem.cr4de_dealintakeapp_RequestStatus.RequestStatus,
   RGBA(255,0,0,1),
   RGBA(0,0,0,1)
)

 

I've just seen you mis-spelled dealintakeapp in your formula so that's likely why its not been picking it up, have edited this response with formula that should work.

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,420)