Skip to main content
Nintex Community Menu Bar
Solved

How to set columns to null via SMO update?

  • April 27, 2020
  • 7 replies
  • 92 views

I have a SMO backed by a DB Table, and I'm trying to set the value of one of the columns to null using Update method but it's not working. I'm doing this from within Workflow and setting the value to EmptyString function.

 

So what's the workaround?

Best answer by Praveen123

Thanks Kimberly. That's what I noticed when I used GetFileFromContent function and passed empty text in content. Looks like we will have to use stored proc or trigger in DB to nullify the column value.

 

Thank you both - Kate and Kimberly - for responding to my query.

 

7 replies

  • April 27, 2020

Hi Praveen123,


 


May I please know on what do you mean by not working ? Is there any error shown ?


 


Cheers,


Kate


  • Author
  • April 27, 2020
It's not updating to null or not clearing the value in DB. I'm also setting another field with different value in same update call and that is getting updated correctly. The column under question is FileContent type in SMO if that helps.

Forum|alt.badge.img+13
  • April 27, 2020

Hi  @Praveen123 ,


 


If the file attachment is saved as scnull, it will be stored in the database as the following:  


<file><name>scnull</name><content>scnull</content></file>


 


That means you will not be able to retrieve the file attachment to be displayed on your Form. Please take note of the impact of doing so. 


 


Cheers,


Kimberly 


 


K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member.


  • Author
  • Answer
  • April 28, 2020

Thanks Kimberly. That's what I noticed when I used GetFileFromContent function and passed empty text in content. Looks like we will have to use stored proc or trigger in DB to nullify the column value.

 

Thank you both - Kate and Kimberly - for responding to my query.

 


Hi,
 
In your workflow you can call your SMO to update your database to set your column to null like this :
 
I tried and it worked for me.
 
Note: I'm working on K2 5.1. What's your version ?
 
Michel From Flow Factory


  • Author
  • April 29, 2020

Thanks for replying. Unfortunately, in my case it's not a Memo type but a File Content type. 


  • July 9, 2021
How to find table name through SMO?