Low-Code: How to extract array object by value with MAKE

In our new blog series, ‘The Low-Code Shift’, we discover and explore trends, solutions, and pitfalls in using No-Code-Low-Code tools. TalentFormation’s Low-Code Expert, Mahmoud Sheikh Alard, will give you first-hand insights and practical tips for using tools like MAKE or other Low-Code-No-Code applications.

THE USE CASE: MARKETING AND SALES AUTOMATION WITH MAKE, MAILCHIMP AND COPPER CRM

We wanted to synchronize Copper custom fields to Mailchimp whenever something is updated in Copper. Still, there was a problem which is that Copper custom fields have their specific numerical ID, and their values are expressed with numerical IDs as well, which makes it hard to:

  • Pinpoint which custom field we want
  • Grab the value of the waned custom field

Of course, we all know how scary this look is for any low-code developer; having no direct way of mapping the required value, to where it’s needed is a primary cause of headache.

WHAT DID WE DO?

  • The very beginning was to create data stores where we map the ID in Copper to the string value in Mailchimp.
  • The second thing was to write this beautiful function that effectively does the following:
    • Join all the values of the custom fields in one long string separated by commas
    • It provides stability to the scenario, that even if the order of the custom fields changes, it still pinpoints the right one.

HOW IS THAT DONE?

    1. Using the join & map functions, we concatenate each “custom_field_definition_id” in one string separated by a comma.
    2. Then using substring, we extract the portion of the string that ends with the value “588916” which is our required custom_field_id in this case
    3. To remove unnecessary digits, we use regex (/ \d+/g) and this is done with the replace function
    4. As now only the commas remain as a string we can count them to get the index of our required custom_field_id in the custom_fields array
    5. Since MAKE does NOT use zero-based indexing, we add the +1 on the length function to pinpoint the correct location of the required value, because the commas counted will be one less than the correct position due to MAKE’s indexing starting from one.
    6. The first get function is used to retrieve the custom_field_definition_id object itself and the second get function is used to retrieve its corresponding value as seen in the picture.

LET’S RECAP

In summary, the process involved creating data stores to map IDs in Copper to string values in Mailchimp. This was followed by the development of a function that concatenates custom field values and pinpoints the correct field, regardless of its order. It was achieved using various functions, including join, map, substring, replace, length, and get.

The resulting function allows for greater stability and accuracy in retrieving and utilising custom field data. By combining the power of JavaScript functions and data mapping, this process demonstrates the potential for creative problem-solving in software development.

And now you, feel free to share with us any creative problem-solving technique you have used before!

If you want more of these tips around using no-code-low-code tools, follow our blog series ‘The Low-Code Shift’.

ABOUT THE AUTHOR

This article was written by Mahmoud Sheikh Alard – Low-Code Specialist at TalentFormation.com GmbH, Hamburg.

TalentFormation is a Company Rebuilder that helps bigger companiestransform their organization and develop, implement and operate new digital business models to perform and grow sustainably.

Together with a growing network of tech service providerssolopreneurs and freelancers, TalentFormation forms highly effective product teams that enable companies to compete with disruptive competitors. For small business owners, we provide the environment to build and scale their company within the TalentFormation Network.

Founded in 2009 in Hamburg, we focus on Company Rebuilding projects in Consumer Products, Mobility, Health, Energy, and other future-proof industries, both for manufacturers and retailers.

Read more