Update a field(date field) on row to blank value

  • 2
  • Question
  • Updated 4 months ago
  • Answered
Hi

I'm trying for a framework action to accomplish the following:

Update field on row

I want to update a Date/Time field (same issue for date field) to a blank value

I looked at this post: https://community.skuidify.com/skuid/topics/best-way-to-set-value-of-field-to-null-blank, but none of the simple methods listed work for date fields

1- the reference to blank UI , would not work for Date fields

2- Using {{blank}}, does not work either

Would there be a simpler way than to use JS?


Thank you,
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb

Posted 3 years ago

  • 2
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
I believe you can use the value of a ui only text formula field which has just "" in it. {{blankText}}
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hi Pat, and thank you

How do I use that value?

As soon as i select a date field for action: update a field on row , it only give me the choice to input a specific date , or use of the "predetermined" ranges.



Where would I reference the UI field?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,674 Points 20k badge 2x thumb
Ah yes. A date field. Pretty much can only do this with a snippet.
Photo of Sarah

Sarah

  • 142 Points 100 badge 2x thumb
I'm trying to create a mass update action that will clear a date field, but I'm running into this same issue. Is a snippet still the only way to make this work? 

Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hi Sarah, unless something has changed recently on skuid, the only way i found it possible with pat's help, is a snippet.

Here snippet I use on a a single record, you will prob need to modify it to use for mass update as this 1 only does it for first row

Create a In-Line Snippet :

var $ = skuid.$, model = skuid.model.getModel('AccountCover'), row = model.getFirstRow(); model.updateRow(row, {API NAME FIELD GOES IN HERE'});

Hope it helps
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
You can use Pat's {{blankText}} approach in the first response, you just have to trick Skuid into it:


  1. Instead of selecting a Date field, select any text field as the one to update.
  2. Enter {{blankText}} (or whatever the name of your blank ui-only formula field is)
  3. Now select the actual Date field that you want to update to blank.
You will still see the date picker in the ui, but don't touch it. The XML behind the scenes will be set to update the field to blank.
Photo of Sarah

Sarah

  • 142 Points 100 badge 2x thumb
Sneaky! Thank you!
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb