cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DomCotton
Frequent Visitor

Upsert salesforce record with null date field

I have a flow which is updating a salesforce object from an external system.  I am using the Order object, and have a field "End Date" which I want to populate but only at the end of the life of the order.

 

Currently I have a switch which says when the order is closed, update a variable with the utcNow() function.  This works if the order is closed, but if the variable is an empty string I get an error "Input parameter 'item/EndDate' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.".  When I initialised the variable i set it to null.

 

Is there a way to conditionally use a field in the upsert operation?

1 ACCEPTED SOLUTION

Accepted Solutions
DomCotton
Frequent Visitor

Hi,

Not sure about the connector you are showing - I don't have the "Column Properties" against the Salesforce Upsert object.

 

I did however solve the issue by just using a simple If statement as below:

 

if(empty(variables('EndDate')),null,variables('EndDate'))

 

This seems to prevent the object from trying to pass a value and solves the issue.

 

Thanks!

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @DomCotton :

Do you want to use a null value to update a date and time column.

If so,you could try null

vbofengmsft_0-1639709147235.png

vbofengmsft_1-1639709163728.png

In addition,please make sure the end field is not a required field:

vbofengmsft_3-1639709251908.png

Best Regards,

Bof

 

 

 

 

DomCotton
Frequent Visitor

Hi,

Not sure about the connector you are showing - I don't have the "Column Properties" against the Salesforce Upsert object.

 

I did however solve the issue by just using a simple If statement as below:

 

if(empty(variables('EndDate')),null,variables('EndDate'))

 

This seems to prevent the object from trying to pass a value and solves the issue.

 

Thanks!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,240)