<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D51Y000096Pd3LSASOkta Classic EngineAnswered2024-02-05T19:40:11.000Z2020-08-04T23:08:13.000Z2023-09-12T00:20:42.000Z

EricP.72813 (Customer) asked a question.

Set profile field to null?

I've noticed that when I call Okta - Update User in Workflows to do a "partial" update, if I leave a field blank in the update, it doesn't blank it in Okta. Instead, it just leaves whatever content is already there.

 

For example, I'm using a workflow to update an address from a location code and a lookup table. Sometimes Address Line 2 has content in the lookup table, but sometimes it's blank . When it's blank, the original content for that field remains, while the other fields get the new address info... leading to a rather confusing and invalid address.

 

Is there a way of setting a single field to blank or null when doing a "partial" update?


  • EricP.72813 (Customer)

    I've found a way to null specific attributes in Workflows. Use the Custom API Action. Set request type to "POST". Compose text for "Relative URL" to be "/api/v1/users/<OktaID>", replacing <OktaID> with your input variable. Compose text or create an object for "Body" with the profile attributes you want to blank. The text would look something like this:

     

    { "profile" : { "attribute1" : null, "attribute2" : null } }

     

    I really think the Update User function should pass null if an input is blank, but I guess Okta chose to omit that attribute instead, leaving the existing value... not sure why that makes sense to them.

     

     

    Expand Post
    Selected as Best
  • Hi Eric,

     

    Sorry for the delay! Partial updates will only update fields that are specified and fields that are empty(blank) will be ignored. Strict updates will set empty(blank) fields to 'null', so if you're wanting to null it, you will need to use the strict update. Are you able to connect to bring in all the data for all the fields to accomplish what you're trying to do?

    Expand Post
  • EricP.72813 (Customer)

    I think the short answer is yes, I can get all the data, but it's not preferred.

     

    We plan to do a number of provisioning integrations over the next couple of years, which undoubtedly means new custom fields will come, and some will go. In workflows, you need to tick off every field you want to copy, so I'd need to go back to each workflow that does this to ensure I don't miss any new fields... or risk setting them to null. Seems like a bad solution.

     

    Is there no way to null all the fields without needing to know all the fields?

    Expand Post
  • EricP.72813 (Customer)

    Sorry, I meant to write "is there no way to null certain fields without needing to know all the fields?"...

  • EricP.72813 (Customer)

    I've found a way to null specific attributes in Workflows. Use the Custom API Action. Set request type to "POST". Compose text for "Relative URL" to be "/api/v1/users/<OktaID>", replacing <OktaID> with your input variable. Compose text or create an object for "Body" with the profile attributes you want to blank. The text would look something like this:

     

    { "profile" : { "attribute1" : null, "attribute2" : null } }

     

    I really think the Update User function should pass null if an input is blank, but I guess Okta chose to omit that attribute instead, leaving the existing value... not sure why that makes sense to them.

     

     

    Expand Post
    Selected as Best
  • Hey Eric, reopening that thread to offer another workaround that doesn't involve creating a new API action.

    My use case is related as I was trying to set a boolean profile attribute to null.

     

    By default if you use the Update User card to set a value to a boolean profile attribute, Workflows would only offer to set it to true or false:

    imageTo set it to null I used that workaround: I click on the T/F dropdown and changed the field type from boolean to string:

    imageThen I just left the string field empty:

    image Running that card effectively set my boolean profile attribute to null/undefined: (view of the user profile in the Okta admin console)

    image 

    Note that I used the partial update option on the card:

    image 

    Hope that helps!

    Nico

    Expand Post
  • EricP.72813 (Customer)

    Thanks for adding that. However, this was permanently resolved in the Update User card some time ago. There is now an option to "Pass Empty Values", which will include the blanks and set them to null. I guess I should have updated this thread at that time, but didn't think about it until I was alerted about your update.

This question is closed.
Loading
Set profile field to null?