I have a flow setup to create a Trello card upon creation of a Sharepoint list item. One of the items I'm putting into the card's description is a date and time value from the Sharepoint list item. I am using a utcnow() function inside a compose step before the card creation step so I can inser the time and date value as a formatted string. See below:
if(equals(triggerBody()?['Due_x0020_Date'],null),'',formatDateTime(addHours(utcNow(triggerBody()?['Due_x0020_Date']),8),'yyyy-MM-dd | HH:mm'))
This works fine if someone enters a value for the date when submitting a new Sharepoint list item. However, if they don't the flow will fail with the following error:
Unable to process template language expressions in action 'Due_Date' inputs at line '1' and column '2112': 'The template language function 'utcNow' expects its parameter to be of type string. The provided value is of type 'Null'.
So, I've tried adding an if() statement to deal with possible null values but can't seem to get it working. I've tried the following unsuccessfully (all provide the exact same error if no value is entered in the 'Due_Date' field when the new items is submitted):
if(equals(triggerBody()?['Due_x0020_Date'],null),'',formatDateTime(addHours(utcNow(triggerBody()?['Due_x0020_Date']),8),'yyyy-MM-dd | HH:mm'))
if(equals(triggerBody()?['Due_x0020_Date'],Null),'',formatDateTime(addHours(utcNow(triggerBody()?['Due_x0020_Date']),8),'yyyy-MM-dd | HH:mm'))
if(equals(triggerBody()?['Due_x0020_Date'],'Null'),'',formatDateTime(addHours(utcNow(triggerBody()?['Due_x0020_Date']),8),'yyyy-MM-dd | HH:mm'))
if(empty(triggerBody()?['Due_x0020_Date']),'',formatDateTime(addHours(utcNow(triggerBody()?['Due_x0020_Date']),8),'yyyy-MM-dd | HH:mm'))
if(empty(triggerBody()?['Due_x0020_Date'],'text',formatDateTime(addHours(utcNow(triggerBody()?['Due_x0020_Date']),8),'yyyy-MM-dd | HH:mm'))
if(equals(triggerBody()?['Due_x0020_Date'],Null),'text',formatDateTime(addHours(utcNow(triggerBody()?['Due_x0020_Date']),8),'yyyy-MM-dd | HH:mm'))
What am I doing wrong?
Solved! Go to Solution.
WHAT a PITA!!!!
But shoutout to @andrew_blubase for alleviating some of the pain with his workaround. Thanks, Andrew!
I have a column in SharePoint list Training link, i am trying to write a expression where i want to skip the flow to run where the column value is NULL and then check the below expression and proceed the next step:
@OR(contains(body('Get_Course_record_by_Course_ID')?['Training_x0020_Link'],toLower('Moodle')),
contains(body('Get_Course_record_by_Course_ID')?['Training_x0020_Link'],toLower('HRClassRoom')))
Can you help me with the expression how can i write this.. maybe if condition expression
HI @REISharepoint ,
I'm not sure I understand what your trying to do perfectly, but feel free to clarify if the following info is not valid for your goals.
1) If you want the flow to NOT run when a particular SharePoint column is null, you can put the following expression in the flow's trigger's "trigger condition" setting:
@if(
equals(
coalesce(
body('Get_Course_record_by_Course_ID')?['TheShPtColumnYouWantToExamineForNull']
, 'ITISNULL'
)
, 'ITISNULL'
)
, false
,true
)
@REISharepoint wrote:I have a column in SharePoint list Training link, i am trying to write a expression where i want to skip the flow to run where the column value is NULL and then check the below expression and proceed the next step:
@OR(contains(body('Get_Course_record_by_Course_ID')?['Training_x0020_Link'],toLower('Moodle')),
contains(body('Get_Course_record_by_Course_ID')?['Training_x0020_Link'],toLower('HRClassRoom')))
Can you help me with the expression how can i write this.. maybe if condition expression
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
26 | |
26 | |
23 | |
13 | |
10 |
User | Count |
---|---|
62 | |
50 | |
30 | |
29 | |
24 |