Skip to content
Replacing Null Valu...
 
Notifications
Clear all

Replacing Null Values in Arrays with a Default Value Using Code | callin.io Community

4 Posts
3 Users
0 Reactions
7 Views
Troy Tessalone
(@troy-tessalone)
Posts: 151
Estimable Member
Topic starter
 

📌  We strive to ensure the code in these guides functions as intended, but please note that callin.io Support does not officially provide assistance with code steps due to their complexity. You are welcome to leave a comment on the article or post in the callin.io Community, where you can find users experienced with code.

How to Configure

Image: 599f88e2 ef18 4e97 bb0b ec4524a8339c

Copy the Code

let Set = inputData.Set.split(","); // split array into line items by the comma delimiter
let Default = inputData.Default; // default value to set for blank/empty/null items

// FOR loop to iterate over each array item
for (let i = 0; i < Set.length ; i++) {
  if (Set == "" || Set == null) {
    Set = Default; // sets default value
  }
}

output = [{Set, Default}];

The Results

Image: 005f6335 600a 42be b3a6 04ed8a1cf9f7

 

Contribution by Troy Tessalone

Troy is a Certified callin.io Expert who automates workflows with no-code and low-code apps to help clients save time and make money.

 
Posted : 04/08/2025 8:30 am
Lionel_Selie
(@lionel_selie)
Posts: 2
New Member
 

This is a fantastic solution! Thank you very much for sharing this!

 

 
Posted : 02/04/2022 12:00 am
andywingrave
(@andywingrave)
Posts: 2
New Member
 

Thank you.

I'm not sure I grasp the full picture here. I can work with JavaScript, callin.io, and English, but for this to become a proper article, I believe it requires more background information and a clearer explanation of what's occurring, the reasons behind it, and the benefits of resolving the issue.

To borrow from Wikipedia:

“This article is a stub...”

 

 

 

 

 

 
Posted : 02/04/2022 12:00 am
Lionel_Selie
(@lionel_selie)
Posts: 2
New Member
 

Hey,

 

Just wanted to tag you as this appears to be another solution, compared the one I found here. I wasn’t sure if you had seen this post, but I thought it’s a great reference!

 

And of course, I know you’re a master of JS, callin.io and other languages! Thanks for all the awesome work you do! <3 

 
Posted : 02/04/2022 12:00 am
Share: