cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Weifeng
Level: Power Up

Is there a way to process null values from CRM to SharePoint

When I try to configure a CRM record to SharePoint list item, an error happened when the field(s) used in the flow steps are null value in CRM. 

 

So is there any way to avoid the error and handle this situation? will the '?' null operator works in the flow?

 

Error Message:

Error
  • Code
    InvalidTemplate
  • Message
    Unable to process template language expressions in action 'Create_item' inputs at line '1' and column '11': 'The template language expression 'triggerBody()['description']' cannot be evaluated because property 'description' doesn't exist, available properties are '@odata.etag, ItemInternalId, territorycode, owningbusinessunit, address2_shippingmethodcode, address1_addressid, creditonhold, donotbulkemail, donotsendmm, createdon, jobtitle, statecode, fullname, donotpostalmail, ownerid, donotbulkpostalmail, modifiedon, isbackofficecustomer, donotemail, address2_addresstypecode, donotphone, transactioncurrencyid, exchangerate, haschildrencode, emailaddress1, statuscode, leadsourcecode, modifiedby, contactid, preferredcontactmethodcode, address3_addressid, lastname, donotfax, telephone1, firstname, educationcode, yomifullname, createdby, merged, customersizecode, address2_addressid, customertypecode, shippingmethodcode, owninguser, participatesinworkflow, preferredappointmenttimecode, address2_freighttermscode'. Please see https://aka.ms/logicexpressions for usage details.'.
1 REPLY 1
Power Apps Staff Samuel
Power Apps Staff

Re: Is there a way to process null values from CRM to SharePoint

Yes, technically the null operator ('?') and/or coalesce() function would work, but they require some hand-crafting if being used in the current Flow editor UI.

 

The workaround is that you can write a raw logicapp expression as long as it evaluates to a string. So for the possibly-null field, instead of using the automatic "Description" token in the UI, you'd write something like:

 

    Desc: @{coalesce(triggerBody()['description'], 'default description text')}

 

The caveats for falling back to a raw logicapp expresion:

    1. Must evaluate to a string

    2. Must have a string or character before the @ sign

    3. The field will become read-only after the initial save.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,830)